Project

General

Profile

Feature #8890 ยป 0001-Eliminate-less-than-zero-checks-for-unsigned-variabl.patch

tonyo (Anton Ovchinnikov), 09/11/2013 06:37 AM

View differences:

ext/bigdecimal/bigdecimal.c
}
nalloc = (ni + nf + BASE_FIG - 1) / BASE_FIG + 1; /* set effective allocation */
/* units for szVal[] */
if (mx <= 0) mx = 1;
if (mx == 0) mx = 1;
nalloc = Max(nalloc, mx);
mx = nalloc;
vp = VpAllocReal(mx);
......
size_t ie, i, nf = 0;
char ch;
if (fFmt <= 0) return;
if (fFmt == 0) return;
ie = strlen(psz);
for (i = 0; i < ie; ++i) {
......
{
size_t i;
if (v->MaxPrec <= 0) {
if (v->MaxPrec == 0) {
printf("ERROR(VpVarCheck): Illegal Max. Precision(=%"PRIuSIZE")\n",
v->MaxPrec);
return 1;
}
if (v->Prec <= 0 || v->Prec > v->MaxPrec) {
if (v->Prec == 0 || v->Prec > v->MaxPrec) {
printf("ERROR(VpVarCheck): Illegal Precision(=%"PRIuSIZE")\n", v->Prec);
printf(" Max. Prec.=%"PRIuSIZE"\n", v->MaxPrec);
return 2;
ext/digest/md5/md5.c
size_t offset = (pms->count[0] >> 3) & 63;
uint32_t nbits = (uint32_t)(nbytes << 3);
if (nbytes <= 0)
if (nbytes == 0)
return;
/* Update the message length. */
ext/json/fbuffer/fbuffer.h
static FBuffer *fbuffer_alloc(unsigned long initial_length)
{
FBuffer *fb;
if (initial_length <= 0) initial_length = FBUFFER_INITIAL_LENGTH_DEFAULT;
if (initial_length == 0) initial_length = FBUFFER_INITIAL_LENGTH_DEFAULT;
fb = ALLOC(FBuffer);
memset((void *) fb, 0, sizeof(FBuffer));
fb->initial_length = initial_length;
ext/json/generator/generator.c
static char *fstrndup(const char *ptr, unsigned long len) {
char *result;
if (len <= 0) return NULL;
if (len == 0) return NULL;
result = ALLOC_N(char, len);
memccpy(result, ptr, 0, len);
return result;
    (1-1/1)