Skip to content

Commit f532262

Browse files
authored
llama : suppress unary minus operator warning (#8448)
This commit updates the _try_copy lambda and moves the unary minus operator to after the cast to int32_t. The motivation for this that currently the following warning is generated on windows: ```console llama.cpp\src\llama.cpp(21147,30): warning C4146: unary minus operator applied to unsigned type, result still unsigned ```
1 parent c3ebcfa commit f532262

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/llama.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21144,7 +21144,7 @@ int32_t llama_token_to_piece(const struct llama_model * model, llama_token token
2114421144
size--;
2114521145
}
2114621146
if (length < (int32_t)size) {
21147-
return (int32_t) -size;
21147+
return -(int32_t) size;
2114821148
}
2114921149
memcpy(buf, token, size);
2115021150
return (int32_t) size;

0 commit comments

Comments
 (0)