pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:1719:    len = in->len * 2;    /* Check how many extra wide characters there are. */    for(i = in->len; i--;) {    if (str2[i] > 0xfffd) {    if (str2[i] < 0x10000) {    /* 0xfffe: Byte-order detection illegal character.    * 0xffff: Illegal character.    */    Pike_error("Illegal character 0x%04x (index %ld) "    "is not a Unicode character.", -  str2[i], PTRDIFF_T_TO_LONG(i)); +  str2[i], (long)i);    }    if (str2[i] > 0x10ffff) {    Pike_error("Character 0x%08x (index %ld) "    "is out of range (0x00000000..0x0010ffff).", -  str2[i], PTRDIFF_T_TO_LONG(i)); +  str2[i], (long)i);    }    /* Extra wide characters take two UTF16 characters in space.    * ie One UTF16 character extra.    */    len += 2;    }    }    out = begin_shared_string(len);    j = len;    for(i = in->len; i--;) {
pike.git/src/builtin_functions.c:1755:    j -= 2;    c >>= 10;    c |= 0xd800;    }    out->str[j + 1 - byteorder] = c & 0xff;    out->str[j + byteorder] = c >> 8;    }   #ifdef PIKE_DEBUG    if (j) {    Pike_fatal("string_to_unicode(): Indexing error: len:%ld, j:%ld.\n", -  PTRDIFF_T_TO_LONG(len), PTRDIFF_T_TO_LONG(j)); +  (long)len, (long)j);    }   #endif /* PIKE_DEBUG */    out = end_shared_string(out);    }    break;    }    pop_n_elems(args);    push_string(out);   }