src/share/instrument/PathCharsValidator.c
Print this page
rev 9508 : 8037825: Fix warnings and enable "warnings as errors" in serviceability native libraries
Reviewed-by:
@@ -44,26 +44,26 @@
static jlong L_PATH;
static jlong H_PATH;
/* Compute the low-order mask for the characters in the given string */
static jlong lowMask(char* s) {
- int n = strlen(s);
+ size_t n = strlen(s);
jlong m = 0;
- int i;
+ size_t i;
for (i = 0; i < n; i++) {
int c = (int)s[i];
if (c < 64)
m |= ((jlong)1 << c);
}
return m;
}
/* Compute the high-order mask for the characters in the given string */
static jlong highMask(char* s) {
- int n = strlen(s);
+ size_t n = strlen(s);
jlong m = 0;
- int i;
+ size_t i;
for (i = 0; i < n; i++) {
int c = (int)s[i];
if ((c >= 64) && (c < 128))
m |= ((jlong)1 << (c - 64));
}
@@ -166,11 +166,11 @@
/*
* Validates that the given URI path component does not contain any
* illegal characters. Returns 0 if only validate characters are present.
*/
int validatePathChars(const char* path) {
- int i, n;
+ size_t i, n;
/* initialize on first usage */
if (L_HEX == 0) {
initialize();
}