Skip to content

Commit eff5934

Browse files
committed
Resolve misc warnings in clang
1 parent 6b475aa commit eff5934

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

ext/jsonnet/callbacks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ invoke_callback(VALUE args)
2727
{
2828
long len = RARRAY_LEN(args);
2929
VALUE callback = rb_ary_entry(args, 0);
30-
return rb_funcall2(callback, id_call, len - 1, RARRAY_PTR(args) + 1);
30+
return rb_funcall2(callback, id_call, (int)(len - 1), RARRAY_PTR(args) + 1);
3131
}
3232

3333
/*

ext/jsonnet/vm.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
#include "ruby_jsonnet.h"
99

10+
#ifndef NORETURN
11+
# define NORETURN(x) x
12+
#endif
13+
1014
/*
1115
* defines the core part of Jsonnet::VM
1216
*/
@@ -424,7 +428,7 @@ rubyjsonnet_init_vm(VALUE mJsonnet)
424428
}
425429

426430
static void
427-
raise_error(VALUE exception_class, struct JsonnetVm *vm, char *msg, rb_encoding *enc)
431+
NORETURN(raise_error)(VALUE exception_class, struct JsonnetVm *vm, char *msg, rb_encoding *enc)
428432
{
429433
VALUE ex;
430434
const int state = rubyjsonnet_jump_tag(msg);
@@ -451,13 +455,13 @@ raise_error(VALUE exception_class, struct JsonnetVm *vm, char *msg, rb_encoding
451455
* @sa rescue_callback
452456
*/
453457
static void
454-
raise_eval_error(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
458+
NORETURN(raise_eval_error)(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
455459
{
456460
raise_error(eEvaluationError, vm, msg, enc);
457461
}
458462

459463
static void
460-
raise_format_error(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
464+
NORETURN(raise_format_error)(struct JsonnetVm *vm, char *msg, rb_encoding *enc)
461465
{
462466
raise_error(eFormatError, vm, msg, enc);
463467
}

0 commit comments

Comments
 (0)