summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Hirokawa <hirokawa@php.net>2002-03-23 01:12:54 +0000
committerRui Hirokawa <hirokawa@php.net>2002-03-23 01:12:54 +0000
commite3f5063ec2d4a862a6f68720d6d687d01650a3a8 (patch)
treebf9e0b028bf44e1c1003309c7d00a348211d6ed4
parent3e348ed92f888b36a5d2af4c3d7cfe4a5f387290 (diff)
downloadphp-git-e3f5063ec2d4a862a6f68720d6d687d01650a3a8.tar.gz
fixed some compilation warning.
-rw-r--r--ext/mbstring/mbregex.c27
-rw-r--r--ext/mbstring/mbstring.c23
2 files changed, 27 insertions, 23 deletions
diff --git a/ext/mbstring/mbregex.c b/ext/mbstring/mbregex.c
index 04c6d214f3..13132ada9a 100644
--- a/ext/mbstring/mbregex.c
+++ b/ext/mbstring/mbregex.c
@@ -560,9 +560,9 @@ re_set_syntax(syntax)
do { \
if (current_mbctype == MBCTYPE_UTF8) { \
int n = mbclen(c) - 1; \
- c &= (1<<(MBRE_BYTEWIDTH-2-n)) - 1; \
+ c &= (1<<(MBRE_BYTEWIDTH-2-n)) - 1; \
while (n--) { \
- c = c << 6 | *p++ & ((1<<6)-1); \
+ c = c << 6 | (*p++ & ((1<<6)-1)); \
} \
} \
else { \
@@ -1351,7 +1351,6 @@ re_compile_pattern(pattern, size, bufp)
int *stackb = stacka;
int *stackp = stackb;
int *stacke = stackb + 40;
- int *stackt;
/* Counts ('s as they are encountered. Remembered for the matching ),
where it becomes the register number to put in the stop_memory
@@ -1592,8 +1591,8 @@ re_compile_pattern(pattern, size, bufp)
case 'W':
for (c = 0; c < (1 << MBRE_BYTEWIDTH); c++) {
if (SYNTAX(c) != Sword &&
- (current_mbctype && !re_mbctab[c] ||
- !current_mbctype && SYNTAX(c) != Sword2))
+ ((current_mbctype && !re_mbctab[c]) ||
+ (!current_mbctype && SYNTAX(c) != Sword2)))
SET_LIST_BIT(c);
}
had_char_class = 1;
@@ -1781,12 +1780,12 @@ re_compile_pattern(pattern, size, bufp)
/* Discard any character set/class bitmap bytes that are all
0 at the end of the map. Decrement the map-length byte too. */
- while ((int)b[-1] > 0 && b[b[-1] - 1] == 0)
+ while ((int)b[-1] > 0 && b[(int)b[-1] - 1] == 0)
b[-1]--;
if (b[-1] != (1 << MBRE_BYTEWIDTH) / MBRE_BYTEWIDTH)
- memmove(&b[b[-1]], &b[(1 << MBRE_BYTEWIDTH) / MBRE_BYTEWIDTH],
+ memmove(&b[(int)b[-1]], &b[(1 << MBRE_BYTEWIDTH) / MBRE_BYTEWIDTH],
2 + EXTRACT_UNSIGNED(&b[(1 << MBRE_BYTEWIDTH) / MBRE_BYTEWIDTH])*8);
- b += b[-1] + 2 + EXTRACT_UNSIGNED(&b[b[-1]])*8;
+ b += b[-1] + 2 + EXTRACT_UNSIGNED(&b[(int)b[-1]])*8;
break;
case '(':
@@ -2307,9 +2306,9 @@ re_compile_pattern(pattern, size, bufp)
while ((int)b[-1] > 0 && b[b[-1] - 1] == 0)
b[-1]--;
if (b[-1] != (1 << MBRE_BYTEWIDTH) / MBRE_BYTEWIDTH)
- memmove(&b[b[-1]], &b[(1 << MBRE_BYTEWIDTH) / MBRE_BYTEWIDTH],
+ memmove(&b[(int)b[-1]], &b[(1 << MBRE_BYTEWIDTH) / MBRE_BYTEWIDTH],
2 + EXTRACT_UNSIGNED(&b[(1 << MBRE_BYTEWIDTH) / MBRE_BYTEWIDTH])*8);
- b += b[-1] + 2 + EXTRACT_UNSIGNED(&b[b[-1]])*8;
+ b += b[-1] + 2 + EXTRACT_UNSIGNED(&b[(int)b[-1]])*8;
break;
case 'w':
@@ -2667,6 +2666,7 @@ insert_jump_n(op, from, to, current_end, n)
If you call this function, you must zero out pending_exact. */
+#if 0
static void
insert_op(op, there, current_end)
int op;
@@ -2680,7 +2680,7 @@ insert_op(op, there, current_end)
there[0] = (char)op;
}
-
+#endif
/* Open up space at location THERE, and insert operation OP followed by
NUM_1 and NUM_2. CURRENT_END gives the end of the storage in use, so
@@ -3174,6 +3174,8 @@ re_compile_fastmap(bufp)
case begpos:
case unused: /* pacify gcc -Wall */
break;
+ case fail:
+ break;
}
/* Get here means we have successfully found the possible starting
@@ -4399,6 +4401,9 @@ re_match(bufp, string_arg, size, pos, regs)
}
SET_REGS_MATCHED;
break;
+ case fail:
+ goto fail;
+ break;
}
#ifdef RUBY
CHECK_INTS;
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index bced5a83d5..cc019e1e12 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -1473,18 +1473,17 @@ PHP_FUNCTION(mb_output_handler)
MBSTRG(outconv) = NULL;
}
/* if content-type is not yet set, set it and activate the converter */
- if (SG(sapi_headers).send_default_content_type) {
- mimetype = SG(default_mimetype) ? SG(default_mimetype) : SAPI_DEFAULT_MIMETYPE;
- charset = mbfl_no2preferred_mime_name(encoding);
- len = (sizeof ("Content-Type:")-1) + strlen(mimetype) + (sizeof (";charset=")-1) + strlen(charset) + 1;
- p = emalloc(len);
- strcpy(p, "Content-Type:");
- strcat(p, mimetype);
- strcat(p, ";charset=");
- strcat(p, charset);
- if (sapi_add_header(p, len, 0) != FAILURE)
- SG(sapi_headers).send_default_content_type = 0;
-
+ if (SG(sapi_headers).send_default_content_type ) {
+ mimetype = SG(default_mimetype) ? SG(default_mimetype) : SAPI_DEFAULT_MIMETYPE;
+ charset = mbfl_no2preferred_mime_name(encoding);
+ len = (sizeof ("Content-Type:")-1) + strlen(mimetype) + (sizeof (";charset=")-1) + strlen(charset) + 1;
+ p = emalloc(len);
+ strcpy(p, "Content-Type:");
+ strcat(p, mimetype);
+ strcat(p, ";charset=");
+ strcat(p, charset);
+ if (sapi_add_header(p, len, 0) != FAILURE)
+ SG(sapi_headers).send_default_content_type = 0;
/* activate the converter */
MBSTRG(outconv) = mbfl_buffer_converter_new(MBSTRG(current_internal_encoding), encoding, 0);
}