mirror of
https://github.com/janet-lang/janet
synced 2024-11-13 04:09:54 +00:00
fix: Fix tests warnings on Mingw
This commit is contained in:
parent
3be71dcc0b
commit
46bf5d1ce5
@ -309,7 +309,7 @@ static EnvBlock os_execute_env(int32_t argc, const Janet *argv) {
|
||||
JanetDictView dict = janet_getdictionary(argv, 2);
|
||||
#ifdef JANET_WINDOWS
|
||||
JanetBuffer *temp = janet_buffer(10);
|
||||
for (int32_t i = 0; i < dict.cap; i++) {
|
||||
for (size_t i = 0; i < dict.cap; i++) {
|
||||
const JanetKV *kv = dict.kvs + i;
|
||||
if (!janet_checktype(kv->key, JANET_STRING)) continue;
|
||||
if (!janet_checktype(kv->value, JANET_STRING)) continue;
|
||||
@ -380,7 +380,7 @@ static void os_execute_cleanup(EnvBlock envp, const char **child_argv) {
|
||||
* a single string of this format. Returns a buffer that can be cast into a c string. */
|
||||
static JanetBuffer *os_exec_escape(JanetView args) {
|
||||
JanetBuffer *b = janet_buffer(0);
|
||||
for (int32_t i = 0; i < args.len; i++) {
|
||||
for (size_t i = 0; i < args.len; i++) {
|
||||
const char *arg = janet_getcstring(args.items, i);
|
||||
|
||||
/* Push leading space if not first */
|
||||
|
@ -895,13 +895,13 @@ void janet_formatbv(JanetBuffer *b, const char *format, va_list args) {
|
||||
case 's':
|
||||
case 'S': {
|
||||
const char *str = va_arg(args, const char *);
|
||||
int32_t len = c[-1] == 's'
|
||||
? (int32_t) strlen(str)
|
||||
size_t len = c[-1] == 's'
|
||||
? strlen(str)
|
||||
: janet_string_length((JanetString) str);
|
||||
if (form[2] == '\0')
|
||||
janet_buffer_push_bytes(b, (const uint8_t *) str, len);
|
||||
else {
|
||||
if (len != (int32_t) strlen((const char *) str))
|
||||
if (len != strlen((const char *) str))
|
||||
janet_panic("string contains zeros");
|
||||
if (!strchr(form, '.') && len >= 100) {
|
||||
janet_panic("no precision and string is too long to be formatted");
|
||||
|
Loading…
Reference in New Issue
Block a user