Skip to content

Commit 3de0082

Browse files
authored
fix: resolve unsigned int initialization warning for n_dims/size in gguf.cpp (#15754)
1 parent 69db8a5 commit 3de0082

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ggml/src/gguf.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ struct gguf_reader {
273273
}
274274

275275
bool read(std::string & dst) const {
276-
uint64_t size = -1;
276+
uint64_t size = 0;
277277
if (!read(size)) {
278278
return false;
279279
}
@@ -523,7 +523,7 @@ struct gguf_context * gguf_init_from_file_impl(FILE * file, struct gguf_init_par
523523

524524
// tensor shape
525525
{
526-
uint32_t n_dims = -1;
526+
uint32_t n_dims = 0;
527527
ok = ok && gr.read(n_dims);
528528
if (n_dims > GGML_MAX_DIMS) {
529529
GGML_LOG_ERROR("%s: tensor '%s' has invalid number of dimensions: %" PRIu32 " > %" PRIu32 "\n",

0 commit comments

Comments
 (0)