diff --git a/ext/standard/html.c b/ext/standard/html.c
index 56b33d4fafd..b9b4a977a7a 100644
--- a/ext/standard/html.c
+++ b/ext/standard/html.c
@@ -271,7 +271,7 @@ static inline unsigned int get_next_char(
MB_FAILURE(pos, 2);
}
pos += 2;
- } else if (c < 0x80 || c >= 0xA1 && c <= 0xDF) {
+ } else if (c < 0x80 || (c >= 0xA1 && c <= 0xDF)) {
this_char = c;
pos += 1;
} else {
@@ -787,8 +787,8 @@ static inline int process_numeric_entity(const char **buf, unsigned *code_point)
/* strtol allows whitespace and other stuff in the beginning
* we're not interested */
- if (hexadecimal && !isxdigit(**buf) ||
- !hexadecimal && !isdigit(**buf)) {
+ if ((hexadecimal && !isxdigit(**buf)) ||
+ (!hexadecimal && !isdigit(**buf))) {
return FAILURE;
}
@@ -821,9 +821,9 @@ static inline int process_named_entity_html(const char **buf, const char **start
* sequence of 8-bit code units. If in the ranges below, it represents
* necessarily a alpha character because none of the supported encodings
* has an overlap with ASCII in the leading byte (only on the second one) */
- while (**buf >= 'a' && **buf <= 'z' ||
- **buf >= 'A' && **buf <= 'Z' ||
- **buf >= '0' && **buf <= '9') {
+ while ((**buf >= 'a' && **buf <= 'z') ||
+ (**buf >= 'A' && **buf <= 'Z') ||
+ (**buf >= '0' && **buf <= '9')) {
(*buf)++;
}
diff --git a/ext/standard/html_tables/html_table_gen.php b/ext/standard/html_tables/html_table_gen.php
index 05997f03754..7e7314fa356 100644
--- a/ext/standard/html_tables/html_table_gen.php
+++ b/ext/standard/html_tables/html_table_gen.php
@@ -25,7 +25,7 @@ $t = << $v) {
if (key_exists("default", $v)) {
if ($v['default'] == 'GT') /* hack to make > translate to > not GT; */
$v['default'] = "gt";
- echo "\t{", sprintf("%02d", count($v) - 1),
+ echo "\t{ {", sprintf("%02d", count($v) - 1),
",\t\t", sprintf("\"%-21s", $v["default"].'",'), "\t",
- sprintf("% 2d", strlen($v["default"])), '},', "\n";
+ sprintf("% 2d", strlen($v["default"])), '} },', "\n";
} else {
- echo "\t{", sprintf("%02d", count($v)),
- ",\t\t", sprintf("%-22s", 'NULL'), ",\t0},\n";
+ echo "\t{ {", sprintf("%02d", count($v)),
+ ",\t\t", sprintf("%-22s", 'NULL'), ",\t0} },\n";
}
unset($v["default"]);
foreach ($v as $l => $w) {
- echo "\t{", sprintf("0x%05s", $l), ",\t", sprintf("\"%-21s", $w.'",'), "\t",
- sprintf("% 2d", strlen($w)), '},', "\n";
+ echo "\t{ {", sprintf("0x%05s", $l), ",\t", sprintf("\"%-21s", $w.'",'), "\t",
+ sprintf("% 2d", strlen($w)), '} },', "\n";
}
echo "};\n";
}
@@ -495,22 +495,22 @@ if ($pass2 < 2)
$t = << 0; $nKeyLength--) {
- $hash = (int)(((int)(((int)($hash << 5)) + $hash)) + ord($str[$pos++]));
+ $hash = (int)(((int)(((int)($hash << 5)) + $hash)) + ord($str[$pos++]))
+ & 0xFFFFFFFF;
}
return $hash;
@@ -762,7 +762,7 @@ for ($i = 0; $i < $numelems; $i++) {
$h[0], strlen($h[0]), hexdec($h[1]));
}
}
- echo " {NULL} };\n";
+ echo " {NULL, 0, 0, 0} };\n";
}
echo "\n";