Skip to content

Commit b50b570

Browse files
authored
ggml : fix fprintf warnings (ggml-org#1720)
1 parent 53aba3f commit b50b570

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

ggml.c

+11-11
Original file line numberDiff line numberDiff line change
@@ -14729,12 +14729,12 @@ static void ggml_graph_export_leaf(const struct ggml_tensor * tensor, FILE * fou
1472914729
const int64_t * ne = tensor->ne;
1473014730
const size_t * nb = tensor->nb;
1473114731

14732-
fprintf(fout, "%-6s %-12s %8d %8d %d %d %d %16zu %16zu %16zu %16zu %16p %32s\n",
14732+
fprintf(fout, "%-6s %-12s %8d %" PRId64 " %" PRId64 " %" PRId64 " %" PRId64 " %16zu %16zu %16zu %16zu %16p %32s\n",
1473314733
ggml_type_name(tensor->type),
1473414734
ggml_op_name (tensor->op),
1473514735
tensor->n_dims,
14736-
(int) ne[0], (int) ne[1], (int) ne[2], (int) ne[3],
14737-
nb[0], nb[1], nb[2], nb[3],
14736+
ne[0], ne[1], ne[2], ne[3],
14737+
nb[0], nb[1], nb[2], nb[3],
1473814738
tensor->data,
1473914739
tensor->name);
1474014740
}
@@ -14743,13 +14743,13 @@ static void ggml_graph_export_node(const struct ggml_tensor * tensor, const char
1474314743
const int64_t * ne = tensor->ne;
1474414744
const size_t * nb = tensor->nb;
1474514745

14746-
fprintf(fout, "%-6s %-6s %-12s %8d %d %d %d %d %16zu %16zu %16zu %16zu %8d %16p %32s\n",
14746+
fprintf(fout, "%-6s %-6s %-12s %8d %" PRId64 " %" PRId64 " %" PRId64 " %" PRId64 " %16zu %16zu %16zu %16zu %8d %16p %32s\n",
1474714747
arg,
1474814748
ggml_type_name(tensor->type),
1474914749
ggml_op_name (tensor->op),
1475014750
tensor->n_dims,
14751-
(int) ne[0], (int) ne[1], (int) ne[2], (int) ne[3],
14752-
nb[0], nb[1], nb[2], nb[3],
14751+
ne[0], ne[1], ne[2], ne[3],
14752+
nb[0], nb[1], nb[2], nb[3],
1475314753
tensor->n_tasks,
1475414754
tensor->data,
1475514755
tensor->name);
@@ -14772,11 +14772,11 @@ void ggml_graph_export(const struct ggml_cgraph * cgraph, const char * fname) {
1477214772
FILE * fout = stdout;
1477314773

1477414774
fprintf(fout, "\n");
14775-
fprintf(fout, "%-16s %8x\n", "magic", GGML_FILE_MAGIC);
14776-
fprintf(fout, "%-16s %8d\n", "version", GGML_FILE_VERSION);
14777-
fprintf(fout, "%-16s %8d\n", "leafs", cgraph->n_leafs);
14778-
fprintf(fout, "%-16s %8d\n", "nodes", cgraph->n_nodes);
14779-
fprintf(fout, "%-16s %8d\n", "eval", (int) size_eval);
14775+
fprintf(fout, "%-16s %8x\n", "magic", GGML_FILE_MAGIC);
14776+
fprintf(fout, "%-16s %8d\n", "version", GGML_FILE_VERSION);
14777+
fprintf(fout, "%-16s %8d\n", "leafs", cgraph->n_leafs);
14778+
fprintf(fout, "%-16s %8d\n", "nodes", cgraph->n_nodes);
14779+
fprintf(fout, "%-16s %" PRIu64 "\n", "eval", size_eval);
1478014780

1478114781
// header
1478214782
fprintf(fout, "\n");

0 commit comments

Comments
 (0)