cvs: php4(PHP_4_2_0) /ext/mbstring mbregex.c mbstring.c
| From: | Rui Hirokawa | Date: | Sat, 23 Mar 2002 01:12:54 +0000 |
| Subject: | cvs: php4(PHP_4_2_0) /ext/mbstring mbregex.c mbstring.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-10595@lists.php.net to get a copy of this message | ||
hirokawa Fri Mar 22 20:12:54 2002 EDT
Modified files: (Branch: PHP_4_2_0)
/php4/ext/mbstring mbregex.c mbstring.c
Log:
fixed some compilation warning.
Index: php4/ext/mbstring/mbregex.c
diff -u php4/ext/mbstring/mbregex.c:1.2 php4/ext/mbstring/mbregex.c:1.2.2.1
--- php4/ext/mbstring/mbregex.c:1.2 Sun Jan 13 22:08:40 2002
+++ php4/ext/mbstring/mbregex.c Fri Mar 22 20:12:54 2002
@@ -560,9 +560,9 @@
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 @@
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 @@
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 @@
/* 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 @@
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 @@
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 @@
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 @@
case begpos:
case unused: /* pacify gcc -Wall */
break;
+ case fail:
+ break;
}
/* Get here means we have successfully found the possible starting
@@ -4398,6 +4400,9 @@
while (--mcnt);
}
SET_REGS_MATCHED;
+ break;
+ case fail:
+ goto fail;
break;
}
#ifdef RUBY
Index: php4/ext/mbstring/mbstring.c
diff -u php4/ext/mbstring/mbstring.c:1.48.2.1 php4/ext/mbstring/mbstring.c:1.48.2.2
--- php4/ext/mbstring/mbstring.c:1.48.2.1 Sat Mar 16 02:13:14 2002
+++ php4/ext/mbstring/mbstring.c Fri Mar 22 20:12:54 2002
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: mbstring.c,v 1.48.2.1 2002/03/16 07:13:14 hirokawa Exp $ */
+/* $Id: mbstring.c,v 1.48.2.2 2002/03/23 01:12:54 hirokawa Exp $ */
/*
* PHP4 Multibyte String module "mbstring" (currently only for Japanese)
@@ -1473,18 +1473,17 @@
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);
}