From: SnA1lGo Date: Tue, 2 Sep 2025 19:27:30 +0000 (+0800) Subject: fix: resolve unsigned int initialization warning for n_dims/size in gguf.cpp (#15754) X-Git-Tag: upstream/0.0.6527~167 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=3de008208b9b8a33f49f979097a99b4d59e6e521;p=pkg%2Fggml%2Fsources%2Fllama.cpp fix: resolve unsigned int initialization warning for n_dims/size in gguf.cpp (#15754) --- diff --git a/ggml/src/gguf.cpp b/ggml/src/gguf.cpp index 53504399..af57a88c 100644 --- a/ggml/src/gguf.cpp +++ b/ggml/src/gguf.cpp @@ -273,7 +273,7 @@ struct gguf_reader { } bool read(std::string & dst) const { - uint64_t size = -1; + uint64_t size = 0; if (!read(size)) { return false; } @@ -523,7 +523,7 @@ struct gguf_context * gguf_init_from_file_impl(FILE * file, struct gguf_init_par // tensor shape { - uint32_t n_dims = -1; + uint32_t n_dims = 0; ok = ok && gr.read(n_dims); if (n_dims > GGML_MAX_DIMS) { GGML_LOG_ERROR("%s: tensor '%s' has invalid number of dimensions: %" PRIu32 " > %" PRIu32 "\n",