pike.git / src / builtin_functions.c

version» Context lines:

pike.git/src/builtin_functions.c:1689:    ptrdiff_t i;       get_all_args("string_to_unicode", args, "%W", &in);       switch(in->size_shift) {    case 0:    /* Just 8bit characters */    len = in->len * 2;    out = begin_shared_string(len);    if (len) { -  MEMSET(out->str, 0, len); /* Clear the upper (and lower) byte */ +  memset(out->str, 0, len); /* Clear the upper (and lower) byte */   #ifdef PIKE_DEBUG    if (d_flag) {    for(i = len; i--;) {    if (out->str[i]) { -  Pike_fatal("MEMSET didn't clear byte %ld of %ld\n", +  Pike_fatal("memset didn't clear byte %ld of %ld\n",    PTRDIFF_T_TO_LONG(i+1),    PTRDIFF_T_TO_LONG(len));    }    }    }   #endif /* PIKE_DEBUG */    for(i = in->len; i--;) {    out->str[i * 2 + 1] = in->str[i];    }    }
pike.git/src/builtin_functions.c:4171:    if (ctx->empty_repl) add_ref(ctx->empty_repl);    for (e = 0; e < num; e++) {    add_ref(ctx->v[e].ind);    add_ref(ctx->v[e].val);    }    }       fsort((char *)ctx->v, num, sizeof(struct replace_many_tupel),    (fsortfun)replace_sortfun);    -  MEMSET(ctx->set_start, 0, sizeof(ctx->set_start)); -  MEMSET(ctx->set_end, 0, sizeof(ctx->set_end)); +  memset(ctx->set_start, 0, sizeof(ctx->set_start)); +  memset(ctx->set_end, 0, sizeof(ctx->set_end));    ctx->other_start = num;       for(e=0;e<num;e++)    {    {    p_wchar2 x;       if (ctx->v[num-1-e].ind->len) {    x=index_shared_string(ctx->v[num-1-e].ind,0);    if ((size_t) x < NELEM(ctx->set_start))
pike.git/src/builtin_functions.c:5924: Inside #if defined (HAVE_MKTIME) || defined (HAVE_LOCALTIME)
   INT_TYPE sec, min, hour, mday, mon, year;    INT_TYPE isdst = -1, tz = 0;    struct tm date;    time_t retval;       if (args<1)    SIMPLE_TOO_FEW_ARGS_ERROR("mktime", 1);       if(args == 1)    { -  MEMSET(&date, 0, sizeof(date)); +  memset(&date, 0, sizeof(date));       push_text("sec");    push_text("min");    push_text("hour");    push_text("mday");    push_text("mon");    push_text("year");    push_text("isdst");    push_text("timezone");    f_aggregate(8);
pike.git/src/builtin_functions.c:5946: Inside #if defined (HAVE_MKTIME) || defined (HAVE_LOCALTIME)
   Pike_sp--;    dmalloc_touch_svalue(Pike_sp);    push_array_items(Pike_sp->u.array);       args=8;    }       get_all_args("mktime",args, "%i%i%i%i%i%i.%i%i",    &sec, &min, &hour, &mday, &mon, &year, &isdst, &tz);    -  MEMSET(&date, 0, sizeof(date)); +  memset(&date, 0, sizeof(date));    date.tm_sec=sec;    date.tm_min=min;    date.tm_hour=hour;    date.tm_mday=mday;    date.tm_mon=mon;    date.tm_year=year;    date.tm_isdst=isdst;       /* date.tm_zone = NULL; */   
pike.git/src/builtin_functions.c:6382:    int minfree = 0;       /* Initialize the lookup table */    max += 1;    max *= 2;    /* max will be the padding at the end. */    size = (nelems + max) * 8; /* Initial size */    if (!(tab = malloc(size + max))) {    SIMPLE_OUT_OF_MEMORY_ERROR("interleave_array", size+max);    } -  MEMSET(tab, 0, size + max); +  memset(tab, 0, size + max);       for (i = 0; i < order->size; i++) {    int low = ITEM(min)[i].u.integer;    int j = ITEM(order)[i].u.integer;    int offset = 0;    int ok = 0;    struct mapping *m;    struct mapping_data *md;    INT32 e;    struct keypair *k;
pike.git/src/builtin_functions.c:6434:    ITEM(min)[i].u.integer = offset;       /* Check need for realloc */    if (offset >= size) {    char *newtab = realloc(tab, size*2 + max);    if (!newtab) {    free(tab);    Pike_error("Couldn't extend table!\n");    }    tab = newtab; -  MEMSET(tab + size + max, 0, size); +  memset(tab + size + max, 0, size);    size = size * 2;    }    }    free(tab);    }       /* We want these two to survive the stackpopping. */    add_ref(min);    add_ref(order);