Skip to content

Conversation

@MaheshJakkala
Copy link

This PR fixes integer type inconsistencies in llama_split_path
and llama_split_prefix.

Changes:

  • Replace API-facing int with int32_t
  • Avoid narrowing conversions from size_t
  • Make signedness and intent explicit

Motivation:

No behavior or API changes intended.

@taronaeo
Copy link
Collaborator

taronaeo commented Jan 13, 2026

image

Why is your commit in the future?

@MaheshJakkala MaheshJakkala force-pushed the fix-integer-types-split branch from c985cbb to 671707e Compare January 14, 2026 04:38
@MaheshJakkala
Copy link
Author

Thanks for pointing this out!
This was caused by an incorrect local system clock.
I’ve amended the commit to fix the timestamp and force-pushed the update.

Copy link
Collaborator

@taronaeo taronaeo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks fine. I'll defer my review to @ggerganov as this affects libllama.

@ggerganov
Copy link
Member

ggerganov commented Jan 16, 2026

I had some minor style fixes somewhere, but I think the branch was write-protected and wasn't able to push.

diff
diff --git a/src/llama.cpp b/src/llama.cpp
index b3275ecae..eca063ecc 100644
--- a/src/llama.cpp
+++ b/src/llama.cpp
@@ -1116,7 +1116,6 @@ int32_t llama_split_path(
     return (int32_t) written;
 }
 
-
 int32_t llama_split_prefix(
     char * split_prefix,
     size_t maxlen,
@@ -1128,8 +1127,8 @@ int32_t llama_split_prefix(
 
     char postfix[32];
     snprintf(postfix, sizeof(postfix), "-%05d-of-%05d.gguf", split_no + 1, split_count);
-    const std::string str_postfix(postfix);
 
+    const std::string str_postfix(postfix);
     if (str_split_path.size() <= str_postfix.size()) {
         return 0;
     }
@@ -1139,13 +1138,13 @@ int32_t llama_split_prefix(
     if (str_split_path.compare(size_prefix, std::string::npos, str_postfix) == 0) {
         const size_t copy_len = std::min(size_prefix + 1, maxlen);
         snprintf(split_prefix, copy_len, "%s", split_path);
+
         return (int32_t) size_prefix;
     }
 
     return 0;
 }
 
-
 const char * llama_print_system_info(void) {
     static std::string s;
     s.clear(); // Clear the string, since it's static, otherwise it will accumulate data from previous calls.

@MaheshJakkala
Copy link
Author

Thanks!
I’ve applied the minor style fixes you suggested and pushed the update.
Please let me know if anything else is needed.

@MaheshJakkala
Copy link
Author

Thanks for the review!

I’ve fixed the EditorConfig issues (trailing whitespace) and pushed the update.

The remaining CI failures appear to be limited to server builds
(Linux & Windows) failing CMake configuration due to missing CURL
("Could NOT find CURL").

This PR does not touch server or CMake logic, so these failures seem
unrelated to the integer-type changes here.

Please let me know if you’d like me to adjust anything on my side,
or if these jobs can be retried / handled upstream.

@taronaeo
Copy link
Collaborator

The remaining CI failures appear to be limited to server builds
(Linux & Windows) failing CMake configuration due to missing CURL
("Could NOT find CURL").

Please try to rebase with master.

@MaheshJakkala
Copy link
Author

I rebased the change cleanly on latest master and pushed a fresh branch
(fix-integer-types-split-clean) to avoid workflow / CI permission issues.
I’ll open a new PR from the clean branch.
Thanks for the review and guidance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants