Permalink
Browse files

Resolve integer-truncation warnings

  • Loading branch information...
1 parent 1dce80b commit 6bfc0f9d82748eb825c34a54cddb5c2c0397da36 @wjk wjk committed Apr 5, 2014
View
2 framework/CocoaOniguruma.xcodeproj/project.pbxproj
@@ -491,6 +491,7 @@
isa = XCBuildConfiguration;
buildSettings = {
GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
ONLY_ACTIVE_ARCH = YES;
@@ -503,6 +504,7 @@
buildSettings = {
DEPLOYMENT_LOCATION = NO;
GCC_C_LANGUAGE_STANDARD = c99;
+ GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
INSTALL_PATH = "";
View
10 framework/core/OnigRegexp.m
@@ -167,7 +167,7 @@ - (OnigResult*)search:(NSString*)target start:(int)start
- (OnigResult*)search:(NSString*)target start:(int)start end:(int)end
{
if (!target) return nil;
- if (end < 0) end = [target length];
+ if (end < 0) end = (int) [target length];
OnigRegion* region = onig_region_new();
const UChar* str = (const UChar*)[target cStringUsingEncoding:STRING_ENCODING];
@@ -195,7 +195,7 @@ - (OnigResult*)search:(NSString*)target start:(int)start end:(int)end
- (OnigResult*)search:(NSString*)target range:(NSRange)range
{
- return [self search:target start:range.location end:NSMaxRange(range)];
+ return [self search:target start:(int) range.location end:(int) NSMaxRange(range)];
}
- (OnigResult*)match:(NSString*)target
@@ -287,7 +287,7 @@ - (NSString*)target
- (int)size
{
- return [self count];
+ return (int) [self count];
}
- (NSUInteger)count
@@ -304,7 +304,7 @@ - (NSArray*)strings
{
NSMutableArray* array = [NSMutableArray array];
int i, count;
- for (i=0, count=[self count]; i<count; i++) {
+ for (i=0, count=(int) [self count]; i<count; i++) {
[array addObject:[self stringAt:i]];
}
return array;
@@ -386,7 +386,7 @@ - (NSIndexSet*)indexesForName:(NSString*)name
- (NSString*)stringForName:(NSString*)name
{
- int n = [self indexForName:name];
+ int n = (int) [self indexForName:name];
return n < 0 ? nil : [self stringAt:n];
}
View
8 framework/core/OnigRegexpUtility.m
@@ -114,8 +114,8 @@ - (NSArray*)split:(id)pattern limit:(NSNumber*)limitNum
OnigResult* res;
while ((res = [pattern search:target start:start])) {
NSRange range = [res bodyRange];
- int end = range.location;
- int right = NSMaxRange(range);
+ int end = (int) range.location;
+ int right = (int) NSMaxRange(range);
if (start == end && range.length == 0) {
if ([target length] == 0) {
@@ -218,11 +218,11 @@ - (NSString*)replaceAllByRegexp:(id)pattern withCallback:(OnigReplaceCallback)ca
do {
NSRange range = [res bodyRange];
- int len = range.location-offset;
+ int len = (int) range.location-offset;
if (len > 0) [s appendString:[self substringWithRange:NSMakeRange(offset, len)]];
[s appendString:callback(res, data, sel)];
- offset = NSMaxRange(range);
+ offset = (int) NSMaxRange(range);
if (range.length == 0) {
// consume 1 character at least
if ([self length] <= offset) break;
View
2 framework/core/oniguruma/enc/utf16_le.c
@@ -106,7 +106,7 @@ utf16le_code_to_mbc(OnigCodePoint code, UChar *buf)
if (code > 0xffff) {
unsigned int plane, high;
- plane = (code >> 16) - 1;
+ plane = (unsigned int) (code >> 16) - 1;
high = (code & 0xff00) >> 8;
*p++ = ((plane & 0x03) << 6) + (high >> 2);
View
28 framework/core/oniguruma/regcomp.c
@@ -52,7 +52,7 @@ static unsigned char PadBuf[WORD_ALIGNMENT_SIZE];
static UChar*
str_dup(UChar* s, UChar* end)
{
- int len = end - s;
+ int len = (int) (end - s);
if (len > 0) {
UChar* r = (UChar* )xmalloc(len + 1);
@@ -73,7 +73,7 @@ swap_node(Node* a, Node* b)
if (NTYPE(a) == NT_STR) {
StrNode* sn = NSTR(a);
if (sn->capa == 0) {
- int len = sn->end - sn->s;
+ int len = (int) (sn->end - sn->s);
sn->s = sn->buf;
sn->end = sn->s + len;
}
@@ -82,7 +82,7 @@ swap_node(Node* a, Node* b)
if (NTYPE(b) == NT_STR) {
StrNode* sn = NSTR(b);
if (sn->capa == 0) {
- int len = sn->end - sn->s;
+ int len = (int) (sn->end - sn->s);
sn->s = sn->buf;
sn->end = sn->s + len;
}
@@ -499,7 +499,7 @@ compile_length_string_raw_node(StrNode* sn, regex_t* reg)
if (sn->end <= sn->s)
return 0;
- return add_compile_string_length(sn->s, 1 /* sb */, sn->end - sn->s, reg, 0);
+ return (int) add_compile_string_length(sn->s, 1 /* sb */, (int) (sn->end - sn->s), reg, 0);
}
static int
@@ -547,7 +547,7 @@ compile_string_raw_node(StrNode* sn, regex_t* reg)
if (sn->end <= sn->s)
return 0;
- return add_compile_string(sn->s, 1 /* sb */, sn->end - sn->s, reg, 0);
+ return (int) add_compile_string(sn->s, 1 /* sb */, (int) (sn->end - sn->s), reg, 0);
}
static int
@@ -2085,7 +2085,7 @@ get_min_match_length(Node* node, OnigDistance *min, ScanEnv* env)
case NT_STR:
{
StrNode* sn = NSTR(node);
- *min = sn->end - sn->s;
+ *min = (OnigDistance) (sn->end - sn->s);
}
break;
@@ -2169,7 +2169,7 @@ get_max_match_length(Node* node, OnigDistance *max, ScanEnv* env)
case NT_STR:
{
StrNode* sn = NSTR(node);
- *max = sn->end - sn->s;
+ *max = (OnigDistance) (sn->end - sn->s);
}
break;
@@ -2542,8 +2542,8 @@ is_not_included(Node* x, Node* y, regex_t* reg)
{
UChar *q;
StrNode* ys = NSTR(y);
- len = NSTRING_LEN(x);
- if (len > NSTRING_LEN(y)) len = NSTRING_LEN(y);
+ len = (int) NSTRING_LEN(x);
+ if (len > (int) NSTRING_LEN(y)) len = (int) NSTRING_LEN(y);
if (NSTRING_IS_AMBIG(x) || NSTRING_IS_AMBIG(y)) {
/* tiny version */
return 0;
@@ -3195,7 +3195,7 @@ update_string_node_case_fold(regex_t* reg, Node *node)
StrNode* sn = NSTR(node);
end = sn->end;
- sbuf_size = (end - sn->s) * 2;
+ sbuf_size = (int) (end - sn->s) * 2;
sbuf = (UChar* )xmalloc(sbuf_size);
CHECK_NULL_RETURN_MEMERR(sbuf);
ebuf = sbuf + sbuf_size;
@@ -3905,7 +3905,7 @@ set_bm_skip(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED,
{
int i, len;
- len = end - s;
+ len = (int) (end - s);
if (len < ONIG_CHAR_TABLE_SIZE) {
for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++) skip[i] = len;
@@ -4581,7 +4581,7 @@ optimize_node_left(Node* node, NodeOptInfo* opt, OptEnv* env)
case NT_STR:
{
StrNode* sn = NSTR(node);
- int slen = sn->end - sn->s;
+ int slen = (int) (sn->end - sn->s);
int is_raw = NSTRING_IS_RAW(node);
if (! NSTRING_IS_AMBIG(node)) {
@@ -4920,7 +4920,7 @@ set_optimize_exact_info(regex_t* reg, OptExactInfo* e)
reg->dmax = e->mmd.max;
if (reg->dmin != ONIG_INFINITE_DISTANCE) {
- reg->threshold_len = reg->dmin + (reg->exact_end - reg->exact);
+ reg->threshold_len = (int) (reg->dmin + (reg->exact_end - reg->exact));
}
return 0;
@@ -5281,7 +5281,7 @@ onig_compile(regex_t* reg, const UChar* pattern, const UChar* pattern_end,
#endif
if (reg->alloc == 0) {
- init_size = (pattern_end - pattern) * 2;
+ init_size = (int) (pattern_end - pattern) * 2;
if (init_size <= 0) init_size = COMPILE_INIT_SIZE;
r = BBUF_INIT(reg, init_size);
if (r != 0) goto end;
View
4 framework/core/oniguruma/regenc.c
@@ -728,7 +728,7 @@ onigenc_mb2_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf)
if (enclen(enc, buf) != (p - buf))
return ONIGERR_INVALID_CODE_POINT_VALUE;
#endif
- return p - buf;
+ return (int) (p - buf);
}
extern int
@@ -751,7 +751,7 @@ onigenc_mb4_code_to_mbc(OnigEncoding enc, OnigCodePoint code, UChar *buf)
if (enclen(enc, buf) != (p - buf))
return ONIGERR_INVALID_CODE_POINT_VALUE;
#endif
- return p - buf;
+ return (int) (p - buf);
}
extern int
View
6 framework/core/oniguruma/regerror.c
@@ -232,7 +232,7 @@ static int to_ascii(OnigEncoding enc, UChar *s, UChar *end,
*is_over = ((p < end) ? 1 : 0);
}
else {
- len = MIN((end - s), buf_size);
+ len = (int) MIN((end - s), buf_size);
xmemcpy(buf, s, (size_t )len);
*is_over = ((buf_size < (end - s)) ? 1 : 0);
}
@@ -296,7 +296,7 @@ onig_error_code_to_str(s, code, va_alist)
}
}
*p = '\0';
- len = p - s;
+ len = (int) (p - s);
break;
default:
@@ -336,7 +336,7 @@ onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)
n = xvsnprintf((char* )buf, bufsize, (const char* )fmt, args);
va_end(args);
- need = (pat_end - pat) * 4 + 4;
+ need = (int) ((pat_end - pat) * 4 + 4);
if (n + need < bufsize) {
strcat((char* )buf, ": /");
View
44 framework/core/oniguruma/regexec.c
@@ -405,7 +405,7 @@ onig_region_copy(OnigRegion* to, OnigRegion* from)
#define STACK_SAVE do{\
if (stk_base != stk_alloc) {\
msa->stack_p = stk_base;\
- msa->stack_n = stk_end - stk_base;\
+ msa->stack_n = (int) (stk_end - stk_base);\
};\
} while(0)
@@ -435,7 +435,7 @@ stack_double(OnigStackType** arg_stk_base, OnigStackType** arg_stk_end,
stk_end = *arg_stk_end;
stk = *arg_stk;
- n = stk_end - stk_base;
+ n = (int) (stk_end - stk_base);
if (stk_base == stk_alloc && IS_NULL(msa->stack_p)) {
x = (OnigStackType* )xmalloc(sizeof(OnigStackType) * n * 2);
if (IS_NULL(x)) {
@@ -1314,7 +1314,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
sbegin = s;
switch (*p++) {
case OP_END: MOP_IN(OP_END);
- n = s - sstart;
+ n = (int) (s - sstart);
if (n > best_len) {
OnigRegion* region;
#ifdef USE_FIND_LONGEST_SEARCH_ALL_OF_RANGE
@@ -1334,18 +1334,18 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
if (IS_POSIX_REGION(msa->options)) {
posix_regmatch_t* rmt = (posix_regmatch_t* )region;
- rmt[0].rm_so = sstart - str;
- rmt[0].rm_eo = s - str;
+ rmt[0].rm_so = (regoff_t) (sstart - str);
+ rmt[0].rm_eo = (regoff_t) (s - str);
for (i = 1; i <= num_mem; i++) {
if (mem_end_stk[i] != INVALID_STACK_INDEX) {
if (BIT_STATUS_AT(reg->bt_mem_start, i))
- rmt[i].rm_so = STACK_AT(mem_start_stk[i])->u.mem.pstr - str;
+ rmt[i].rm_so = (int) (STACK_AT(mem_start_stk[i])->u.mem.pstr - str);
else
- rmt[i].rm_so = (UChar* )((void* )(mem_start_stk[i])) - str;
+ rmt[i].rm_so = (int) ((UChar* )((void* )(mem_start_stk[i])) - str);
rmt[i].rm_eo = (BIT_STATUS_AT(reg->bt_mem_end, i)
? STACK_AT(mem_end_stk[i])->u.mem.pstr
- : (UChar* )((void* )mem_end_stk[i])) - str;
+ : ((UChar* )((void* )mem_end_stk[i])) - (regoff_t) str);
}
else {
rmt[i].rm_so = rmt[i].rm_eo = ONIG_REGION_NOTPOS;
@@ -1354,18 +1354,18 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
else {
#endif /* USE_POSIX_API_REGION_OPTION */
- region->beg[0] = sstart - str;
- region->end[0] = s - str;
+ region->beg[0] = (int) (sstart - str);
+ region->end[0] = (int) (s - str);
for (i = 1; i <= num_mem; i++) {
if (mem_end_stk[i] != INVALID_STACK_INDEX) {
if (BIT_STATUS_AT(reg->bt_mem_start, i))
- region->beg[i] = STACK_AT(mem_start_stk[i])->u.mem.pstr - str;
+ region->beg[i] = (int) (STACK_AT(mem_start_stk[i])->u.mem.pstr - str);
else
- region->beg[i] = (UChar* )((void* )mem_start_stk[i]) - str;
+ region->beg[i] = (int) ((UChar* )((void* )mem_start_stk[i]) - str);
region->end[i] = (BIT_STATUS_AT(reg->bt_mem_end, i)
? STACK_AT(mem_end_stk[i])->u.mem.pstr
- : (UChar* )((void* )mem_end_stk[i])) - str;
+ : (UChar* )((void* )mem_end_stk[i])) - (int) str;
}
else {
region->beg[i] = region->end[i] = ONIG_REGION_NOTPOS;
@@ -1387,8 +1387,8 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
}
node->group = 0;
- node->beg = sstart - str;
- node->end = s - str;
+ node->beg = (int) (sstart - str);
+ node->end = (int) (s - str);
stkp = stk_base;
r = make_capture_history_tree(region->history_root, &stkp,
@@ -2155,7 +2155,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
pend = (BIT_STATUS_AT(reg->bt_mem_end, mem)
? STACK_AT(mem_end_stk[mem])->u.mem.pstr
: (UChar* )((void* )mem_end_stk[mem]));
- n = pend - pstart;
+ n = (int) (pend - pstart);
DATA_ENSURE(n);
sprev = s;
STRING_CMP(pstart, s, n);
@@ -2187,7 +2187,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
pend = (BIT_STATUS_AT(reg->bt_mem_end, mem)
? STACK_AT(mem_end_stk[mem])->u.mem.pstr
: (UChar* )((void* )mem_end_stk[mem]));
- n = pend - pstart;
+ n = (int) (pend - pstart);
DATA_ENSURE(n);
sprev = s;
STRING_CMP_IC(case_fold_flag, pstart, &s, n);
@@ -2219,7 +2219,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
pend = (BIT_STATUS_AT(reg->bt_mem_end, mem)
? STACK_AT(mem_end_stk[mem])->u.mem.pstr
: (UChar* )((void* )mem_end_stk[mem]));
- n = pend - pstart;
+ n = (int) (pend - pstart);
DATA_ENSURE(n);
sprev = s;
swork = s;
@@ -2258,7 +2258,7 @@ match_at(regex_t* reg, const UChar* str, const UChar* end,
pend = (BIT_STATUS_AT(reg->bt_mem_end, mem)
? STACK_AT(mem_end_stk[mem])->u.mem.pstr
: (UChar* )((void* )mem_end_stk[mem]));
- n = pend - pstart;
+ n = (int) (pend - pstart);
DATA_ENSURE(n);
sprev = s;
swork = s;
@@ -2886,7 +2886,7 @@ bm_search_notrev(regex_t* reg, const UChar* target, const UChar* target_end,
#endif
tail = target_end - 1;
- tlen1 = tail - target;
+ tlen1 = (int) (tail - target);
end = text_range;
if (end + tlen1 > text_end)
end = text_end - tlen1;
@@ -2977,7 +2977,7 @@ set_bm_backward_skip(UChar* s, UChar* end, OnigEncoding enc ARG_UNUSED,
if (IS_NULL(*skip)) return ONIGERR_MEMORY;
}
- len = end - s;
+ len = (int) (end - s);
for (i = 0; i < ONIG_CHAR_TABLE_SIZE; i++)
(*skip)[i] = len;
@@ -3745,7 +3745,7 @@ onig_search(regex_t* reg, const UChar* str, const UChar* end,
match:
ONIG_STATE_DEC_THREAD(reg);
MATCH_ARG_FREE(msa);
- return s - str;
+ return (int) (s - str);
}
extern OnigEncoding
View
2 framework/core/oniguruma/regext.c
@@ -95,7 +95,7 @@ static int
conv_encoding(OnigEncoding from, OnigEncoding to, const UChar* s, const UChar* end,
UChar** conv, UChar** conv_end)
{
- int len = end - s;
+ int len = (int) (end - s);
if (to == ONIG_ENCODING_UTF16_LE) {
if (from == ONIG_ENCODING_ASCII) {
View
4 framework/core/oniguruma/regint.h
@@ -279,7 +279,7 @@ typedef unsigned int BitStatusType;
#define INT_MAX_LIMIT ((1UL << (SIZEOF_INT * 8 - 1)) - 1)
-#define DIGITVAL(code) ((code) - '0')
+#define DIGITVAL(code) ((int) ((code) - '0'))
#define ODIGITVAL(code) DIGITVAL(code)
#define XDIGITVAL(enc,code) \
(ONIGENC_IS_CODE_DIGIT(enc,code) ? DIGITVAL(code) \
@@ -575,7 +575,7 @@ typedef void* PointerType;
#define GET_STATE_CHECK_NUM_INC(num,p) PLATFORM_GET_INC(num, p, StateCheckNumType)
/* code point's address must be aligned address. */
-#define GET_CODE_POINT(code,p) code = *((OnigCodePoint* )(p))
+#define GET_CODE_POINT(code,p) code = (int) *((OnigCodePoint* )(p))
#define GET_BYTE_INC(byte,p) do{\
byte = *(p);\
(p)++;\
View
32 framework/core/oniguruma/regparse.c
@@ -218,7 +218,7 @@ onig_strncmp(const UChar* s1, const UChar* s2, int n)
extern void
onig_strcpy(UChar* dest, const UChar* src, const UChar* end)
{
- int len = end - src;
+ int len = (int) (end - src);
if (len > 0) {
xmemcpy(dest, src, len);
dest[len] = (UChar )0;
@@ -232,7 +232,7 @@ strdup_with_null(OnigEncoding enc, UChar* s, UChar* end)
int slen, term_len, i;
UChar *r;
- slen = end - s;
+ slen = (int) (end - s);
term_len = ONIGENC_MBC_MINLEN(enc);
r = (UChar* )xmalloc(slen + term_len);
@@ -734,7 +734,7 @@ name_add(regex_t* reg, UChar* name, UChar* name_end, int backref, ScanEnv* env)
onig_st_insert_strend(t, e->name, (e->name + (name_end - name)),
(HashDataType )e);
- e->name_len = name_end - name;
+ e->name_len = (int) (name_end - name);
e->back_num = 0;
e->back_alloc = 0;
e->back_refs = (int* )NULL;
@@ -1411,10 +1411,10 @@ node_new_option(OnigOptionType option)
extern int
onig_node_str_cat(Node* node, const UChar* s, const UChar* end)
{
- int addlen = end - s;
+ int addlen = (int) (end - s);
if (addlen > 0) {
- int len = NSTR(node)->end - NSTR(node)->s;
+ int len = (int) (NSTR(node)->end - NSTR(node)->s);
if (NSTR(node)->capa > 0 || (len + addlen > NODE_STR_BUF_SIZE - 1)) {
UChar* p;
@@ -1620,7 +1620,7 @@ scan_unsigned_hexadecimal_number(UChar** src, UChar* end, int maxlen,
if ((INT_MAX_LIMIT - val) / 16UL < num)
return -1; /* overflow */
- num = (num << 4) + XDIGITVAL(enc,c);
+ num = (num << 4) + (int) XDIGITVAL(enc,c);
}
else {
PUNFETCH;
@@ -1710,15 +1710,15 @@ add_code_range_to_buf(BBuf** pbuf, OnigCodePoint from, OnigCodePoint to)
data = (OnigCodePoint* )(bbuf->p);
data++;
- for (low = 0, bound = n; low < bound; ) {
+ for (low = 0, bound = (int) n; low < bound; ) {
x = (low + bound) >> 1;
if (from > data[x*2 + 1])
low = x + 1;
else
bound = x;
}
- for (high = low, bound = n; high < bound; ) {
+ for (high = low, bound = (int) n; high < bound; ) {
x = (high + bound) >> 1;
if (to >= data[x*2] - 1)
high = x + 1;
@@ -1740,7 +1740,7 @@ add_code_range_to_buf(BBuf** pbuf, OnigCodePoint from, OnigCodePoint to)
if (inc_n != 0 && (OnigCodePoint )high < n) {
int from_pos = SIZE_CODE_POINT * (1 + high * 2);
int to_pos = SIZE_CODE_POINT * (1 + (low + 1) * 2);
- int size = (n - high) * 2 * SIZE_CODE_POINT;
+ int size = (int) ((n - high) * 2 * SIZE_CODE_POINT);
if (inc_n > 0) {
BBUF_MOVE_RIGHT(bbuf, from_pos, to_pos, size);
@@ -1961,7 +1961,7 @@ and_code_range_buf(BBuf* bbuf1, int not1, BBuf* bbuf2, int not2, BBuf** pbuf)
for (i = 0; i < n1; i++) {
from1 = data1[i*2];
to1 = data1[i*2+1];
- r = and_code_range1(pbuf, from1, to1, data2, n2);
+ r = and_code_range1(pbuf, from1, to1, data2, (int) n2);
if (r != 0) return r;
}
}
@@ -2461,13 +2461,13 @@ fetch_escaped_value(UChar** src, UChar* end, ScanEnv* env)
default:
{
backslash:
- c = conv_backslash_value(c, env);
+ c = conv_backslash_value((int) c, env);
}
break;
}
*src = p;
- return c;
+ return (int) c;
}
static int fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env);
@@ -2918,7 +2918,7 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
PFETCH(c);
tok->type = TK_CHAR;
tok->base = 0;
- tok->u.c = c;
+ tok->u.c = (int) c;
tok->escaped = 0;
if (c == ']') {
@@ -2935,7 +2935,7 @@ fetch_token_in_cc(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
PFETCH(c);
tok->escaped = 1;
- tok->u.c = c;
+ tok->u.c = (int) c;
switch (c) {
case 'w':
tok->type = TK_CHAR_TYPE;
@@ -3145,7 +3145,7 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
tok->backp = p;
PFETCH(c);
- tok->u.c = c;
+ tok->u.c = (int) c;
tok->escaped = 1;
switch (c) {
case '*':
@@ -3581,7 +3581,7 @@ fetch_token(OnigToken* tok, UChar** src, UChar* end, ScanEnv* env)
}
}
else {
- tok->u.c = c;
+ tok->u.c = (int) c;
tok->escaped = 0;
#ifdef USE_VARIABLE_META_CHARS
View
2 framework/core/oniguruma/regparse.h
@@ -96,7 +96,7 @@
#define NSTR_AMBIG (1<<1)
#define NSTR_DONT_GET_OPT_INFO (1<<2)
-#define NSTRING_LEN(node) ((node)->u.str.end - (node)->u.str.s)
+#define NSTRING_LEN(node) ((node)->u.str.end - (int) (node)->u.str.s)
#define NSTRING_SET_RAW(node) (node)->u.str.flag |= NSTR_RAW
#define NSTRING_CLEAR_RAW(node) (node)->u.str.flag &= ~NSTR_RAW
#define NSTRING_SET_AMBIG(node) (node)->u.str.flag |= NSTR_AMBIG
View
4 framework/core/oniguruma/st.c
@@ -118,7 +118,7 @@ new_size(size)
i < (int )(sizeof(primes)/sizeof(primes[0]));
i++, newsize <<= 1)
{
- if (newsize > size) return primes[i];
+ if (newsize > size) return (int) primes[i];
}
/* Ran out of polynomials */
return -1; /* should raise exception */
@@ -574,5 +574,5 @@ static int
numhash(n)
long n;
{
- return n;
+ return (int) n;
}

0 comments on commit 6bfc0f9

Please sign in to comment.