Enlightenment CVS committal Author : raster Project : e17 Module : libs/evas
Dir : e17/libs/evas/src/lib/canvas Modified Files: evas_font_dir.c evas_name.c evas_object_image.c evas_object_smart.c evas_object_text.c evas_object_textblock.c Log Message: disable stringshare... something fishy. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/canvas/evas_font_dir.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -3 -r1.11 -r1.12 --- evas_font_dir.c 28 Nov 2005 15:18:00 -0000 1.11 +++ evas_font_dir.c 29 Nov 2005 09:02:51 -0000 1.12 @@ -94,7 +94,7 @@ p = strchr(name, ','); if (!p) { - fonts = evas_list_append(fonts, evas_stringshare_add(name)); + fonts = evas_list_append(fonts, strdup(name)); } else { @@ -110,7 +110,7 @@ fonts = evas_list_append(fonts, nm); pp = p + 1; p = strchr(pp, ','); - if (!p) fonts = evas_list_append(fonts, evas_stringshare_add(pp)); + if (!p) fonts = evas_list_append(fonts, strdup(pp)); } } return fonts; @@ -145,8 +145,8 @@ fd = evas_list_data(fonts_zero); if (fd->ref != 0) break; fonts_zero = evas_list_remove_list(fonts_zero, fonts_zero); - if (fd->name) evas_stringshare_del(fd->name); - if (fd->source) evas_stringshare_del(fd->source); + if (fd->name) free(fd->name); + if (fd->source) free(fd->source); evas->engine.func->font_free(evas->engine.data.output, fd->font); free(fd); } @@ -323,14 +323,14 @@ } #endif } - evas_stringshare_del(nm); + free(nm); } evas_list_free(fonts); fd = calloc(1, sizeof(Fndat)); if (fd) { - fd->name = evas_stringshare_add(name); - if (source) fd->source = evas_stringshare_add(source); + fd->name = strdup(name); + if (source) fd->source = strdup(source); fd->size = size; fd->font = font; fd->ref = 1; @@ -525,7 +525,7 @@ fn->type = 1; for (i = 0; i < 14; i++) { - fn->x.prop[i] = evas_stringshare_add(font_prop[i]); + fn->x.prop[i] = strdup(font_prop[i]); /* FIXME: what if strdup fails! */ } fn->path = evas_file_path_join(dir, fname); @@ -553,7 +553,7 @@ if (fn) { fn->type = 0; - fn->simple.name = evas_stringshare_add(fdir->data); + fn->simple.name = strdup(fdir->data); if (fn->simple.name) { char *p; @@ -591,11 +591,11 @@ fa = calloc(1, sizeof(Evas_Font_Alias)); if (fa) { - fa->alias = evas_stringshare_add(fname); + fa->alias = strdup(fname); fa->fn = object_text_font_cache_font_find_x(fd, fdef); if ((!fa->alias) || (!fa->fn)) { - if (fa->alias) evas_stringshare_del(fa->alias); + if (fa->alias) free(fa->alias); free(fa); } else @@ -637,10 +637,10 @@ fd->fonts = evas_list_remove(fd->fonts, fn); for (i = 0; i < 14; i++) { - if (fn->x.prop[i]) evas_stringshare_del(fn->x.prop[i]); + if (fn->x.prop[i]) free(fn->x.prop[i]); } - if (fn->simple.name) evas_stringshare_del(fn->simple.name); - if (fn->path) evas_stringshare_del(fn->path); + if (fn->simple.name) free(fn->simple.name); + if (fn->path) free(fn->path); free(fn); } while (fd->aliases) @@ -649,7 +649,7 @@ fa = fd->aliases->data; fd->aliases = evas_list_remove(fd->aliases, fa); - if (fa->alias) evas_stringshare_del(fa->alias); + if (fa->alias) free(fa->alias); free(fa); } free(fd); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/canvas/evas_name.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- evas_name.c 28 Nov 2005 15:18:00 -0000 1.7 +++ evas_name.c 29 Nov 2005 09:02:51 -0000 1.8 @@ -22,13 +22,13 @@ if (obj->name) { obj->layer->evas->name_hash = evas_hash_del(obj->layer->evas->name_hash, obj->name, obj); - evas_stringshare_del(obj->name); + free(obj->name); } if (!name) obj->name = NULL; else { - obj->name = evas_stringshare_add(name); - obj->layer->evas->name_hash = evas_hash_direct_add(obj->layer->evas->name_hash, obj->name, obj); + obj->name = strdup(name); + obj->layer->evas->name_hash = evas_hash_add(obj->layer->evas->name_hash, obj->name, obj); } } =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/canvas/evas_object_image.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -3 -r1.35 -r1.36 --- evas_object_image.c 28 Nov 2005 15:18:00 -0000 1.35 +++ evas_object_image.c 29 Nov 2005 09:02:51 -0000 1.36 @@ -138,11 +138,11 @@ if ((o->cur.key) && (key) && (!strcmp(o->cur.key, key))) return; } - if (o->cur.file) evas_stringshare_del(o->cur.file); - if (o->cur.key) evas_stringshare_del(o->cur.key); - if (file) o->cur.file = evas_stringshare_add(file); + if (o->cur.file) free(o->cur.file); + if (o->cur.key) free(o->cur.key); + if (file) o->cur.file = strdup(file); else o->cur.file = NULL; - if (key) o->cur.key = evas_stringshare_add(key); + if (key) o->cur.key = strdup(key); else o->cur.key = NULL; o->prev.file = NULL; o->prev.key = NULL; @@ -1330,8 +1330,8 @@ return; MAGIC_CHECK_END(); /* free obj */ - if (o->cur.file) evas_stringshare_del(o->cur.file); - if (o->cur.key) evas_stringshare_del(o->cur.key); + if (o->cur.file) free(o->cur.file); + if (o->cur.key) free(o->cur.key); if (o->engine_data) obj->layer->evas->engine.func->image_free(obj->layer->evas->engine.data.output, o->engine_data); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/canvas/evas_object_smart.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -3 -r1.18 -r1.19 --- evas_object_smart.c 28 Nov 2005 15:18:00 -0000 1.18 +++ evas_object_smart.c 29 Nov 2005 09:02:51 -0000 1.19 @@ -225,7 +225,7 @@ if (!event) return; if (!func) return; cb = calloc(1, sizeof(Evas_Smart_Callback)); - cb->event = evas_stringshare_add(event); + cb->event = strdup(event); cb->func = func; cb->func_data = (void *)data; obj->smart.callbacks = evas_list_prepend(obj->smart.callbacks, cb); @@ -326,7 +326,7 @@ if (cb->delete_me) { obj->smart.callbacks = evas_list_remove(obj->smart.callbacks, cb); - if (cb->event) evas_stringshare_add(cb->event); + if (cb->event) free(cb->event); free(cb); } } @@ -359,7 +359,7 @@ cb = obj->smart.callbacks->data; obj->smart.callbacks = evas_list_remove(obj->smart.callbacks, cb); - if (cb->event) evas_stringshare_add(cb->event); + if (cb->event) free(cb->event); free(cb); } obj->smart.parent = NULL; =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/canvas/evas_object_text.c,v retrieving revision 1.47 retrieving revision 1.48 diff -u -3 -r1.47 -r1.48 --- evas_object_text.c 28 Nov 2005 15:18:00 -0000 1.47 +++ evas_object_text.c 29 Nov 2005 09:02:51 -0000 1.48 @@ -108,8 +108,8 @@ if ((o->cur.source) && (font_source) && (!strcmp(o->cur.source, font_source))) return; - if (o->cur.source) evas_stringshare_del(o->cur.source); - if (font_source) o->cur.source = evas_stringshare_add(font_source); + if (o->cur.source) free(o->cur.source); + if (font_source) o->cur.source = strdup(font_source); else o->cur.source = NULL; } @@ -179,8 +179,8 @@ o->engine_data = evas_font_load(obj->layer->evas, font, o->cur.source, size); if (!same_font) { - if (o->cur.font) evas_stringshare_del(o->cur.font); - if (font) o->cur.font = evas_stringshare_add(font); + if (o->cur.font) free(o->cur.font); + if (font) o->cur.font = strdup(font); else o->cur.font = NULL; o->prev.font = NULL; } @@ -293,8 +293,8 @@ obj->layer->evas->pointer.x, obj->layer->evas->pointer.y, 1, 1); /* DO II */ - if (o->cur.text) evas_stringshare_del(o->cur.text); - if (text && *text) o->cur.text = evas_stringshare_add(text); + if (o->cur.text) free(o->cur.text); + if (text && *text) o->cur.text = strdup(text); else o->cur.text = NULL; o->prev.text = NULL; if ((o->engine_data) && (o->cur.text)) @@ -917,7 +917,7 @@ MAGIC_CHECK_END(); while (e->font_path) { - evas_stringshare_del(e->font_path->data); + free(e->font_path->data); e->font_path = evas_list_remove(e->font_path, e->font_path->data); } } @@ -935,7 +935,7 @@ return; MAGIC_CHECK_END(); if (!path) return; - e->font_path = evas_list_append(e->font_path, evas_stringshare_add(path)); + e->font_path = evas_list_append(e->font_path, strdup(path)); } /** @@ -951,7 +951,7 @@ return; MAGIC_CHECK_END(); if (!path) return; - e->font_path = evas_list_prepend(e->font_path, evas_stringshare_add(path)); + e->font_path = evas_list_prepend(e->font_path, strdup(path)); } /** @@ -1197,9 +1197,9 @@ return; MAGIC_CHECK_END(); /* free obj */ - if (o->cur.text) evas_stringshare_del(o->cur.text); - if (o->cur.font) evas_stringshare_del(o->cur.font); - if (o->cur.source) evas_stringshare_del(o->cur.source); + if (o->cur.text) free(o->cur.text); + if (o->cur.font) free(o->cur.font); + if (o->cur.source) free(o->cur.source); if (o->engine_data) evas_font_free(obj->layer->evas, o->engine_data); o->magic = 0; free(o); =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/evas/src/lib/canvas/evas_object_textblock.c,v retrieving revision 1.119 retrieving revision 1.120 diff -u -3 -r1.119 -r1.120 --- evas_object_textblock.c 28 Nov 2005 15:30:07 -0000 1.119 +++ evas_object_textblock.c 29 Nov 2005 09:02:51 -0000 1.120 @@ -329,10 +329,14 @@ s = ts; *alloc = talloc; } - tbuf = alloca(*len - pos); - strncpy(tbuf, s + pos, *len - pos); - strncpy(s + pos, s2, l2); - strncpy(s + pos + l2, tbuf, *len - pos); + tbuf = malloc(*len - pos); + if (tbuf) + { + strncpy(tbuf, s + pos, *len - pos); + strncpy(s + pos, s2, l2); + strncpy(s + pos + l2, tbuf, *len - pos); + free(tbuf); + } *len = tlen; s[tlen] = 0; return s; @@ -351,9 +355,10 @@ *alloc = 0; return NULL; } - tbuf = alloca(*len - p2 + 1); + tbuf = malloc(*len - p2 + 1); strcpy(tbuf, s + p2); strcpy(s + p, tbuf); + free(tbuf); tlen = *len - (p2 - p); if (tlen < ((*alloc >> 5) << 15)) { @@ -392,9 +397,9 @@ { fmt->ref--; if (fmt->ref > 0) return; - if (fmt->font.name) evas_stringshare_del(fmt->font.name); - if (fmt->font.fallbacks) evas_stringshare_del(fmt->font.fallbacks); - if (fmt->font.source) evas_stringshare_del(fmt->font.source); + if (fmt->font.name) free(fmt->font.name); + if (fmt->font.fallbacks) free(fmt->font.fallbacks); + if (fmt->font.source) free(fmt->font.source); evas_font_free(obj->layer->evas, fmt->font.font); free(fmt); } @@ -418,7 +423,7 @@ fi = (Evas_Object_Textblock_Format_Item *)ln->format_items; ln->format_items = evas_object_list_remove(ln->format_items, ln->format_items); - if (fi->item) evas_stringshare_del(fi->item); + if (fi->item) free(fi->item); free(fi); } free(ln); @@ -700,11 +705,15 @@ { char *ts; - ts = alloca(p - s + 1); - strncpy(ts, s, p - s); - ts[p - s] = 0; - ts = _clean_white(0, 0, ts); - evas_textblock_cursor_text_append(o->cursor, ts); + ts = malloc(p - s + 1); + if (ts) + { + strncpy(ts, s, p - s); + ts[p - s] = 0; + ts = _clean_white(0, 0, ts); + evas_textblock_cursor_text_append(o->cursor, ts); + free(ts); + } } } @@ -773,8 +782,8 @@ if ((!fmt->font.name) || ((fmt->font.name) && (strcmp(fmt->font.name, param)))) { - if (fmt->font.name) evas_stringshare_del(fmt->font.name); - fmt->font.name = evas_stringshare_add(param); + if (fmt->font.name) free(fmt->font.name); + fmt->font.name = strdup(param); new_font = 1; } } @@ -786,8 +795,8 @@ /* policy - when we say "fallbacks" do we prepend and use prior * fallbacks... or shoudl we replace. for nwo we replace */ - if (fmt->font.fallbacks) evas_stringshare_del(fmt->font.fallbacks); - fmt->font.fallbacks = evas_stringshare_add(param); + if (fmt->font.fallbacks) free(fmt->font.fallbacks); + fmt->font.fallbacks = strdup(param); new_font = 1; } } @@ -807,8 +816,8 @@ if ((!fmt->font.source) || ((fmt->font.source) && (strcmp(fmt->font.source, param)))) { - if (fmt->font.source) evas_stringshare_del(fmt->font.source); - fmt->font.source = evas_stringshare_add(param); + if (fmt->font.source) free(fmt->font.source); + fmt->font.source = strdup(param); new_font = 1; } } @@ -858,11 +867,14 @@ { char *ts, *p; - ts = alloca(strlen(param)); - strcpy(ts, param); - p = strchr(ts, '%'); - *p = 0; - fmt->halign = ((double)atoi(ts)) / 100.0; + ts = strdup(param); + if (ts) + { + p = strchr(ts, '%'); + *p = 0; + fmt->halign = ((double)atoi(ts)) / 100.0; + free(ts); + } if (fmt->halign < 0.0) fmt->halign = 0.0; else if (fmt->halign > 1.0) fmt->halign = 1.0; } @@ -885,11 +897,14 @@ { char *ts, *p; - ts = alloca(strlen(param)); - strcpy(ts, param); - p = strchr(ts, '%'); - *p = 0; - fmt->valign = ((double)atoi(ts)) / 100.0; + ts = strdup(param); + if (ts) + { + p = strchr(ts, '%'); + *p = 0; + fmt->valign = ((double)atoi(ts)) / 100.0; + free(ts); + } if (fmt->valign < 0.0) fmt->valign = 0.0; else if (fmt->valign > 1.0) fmt->valign = 1.0; } @@ -1133,9 +1148,9 @@ fmt2 = calloc(1, sizeof(Evas_Object_Textblock_Format)); memcpy(fmt2, fmt, sizeof(Evas_Object_Textblock_Format)); fmt2->ref = 1; - if (fmt->font.name) fmt2->font.name = evas_stringshare_add(fmt->font.name); - if (fmt->font.fallbacks) fmt2->font.fallbacks = evas_stringshare_add(fmt->font.fallbacks); - if (fmt->font.source) fmt2->font.source = evas_stringshare_add(fmt->font.source); + if (fmt->font.name) fmt2->font.name = strdup(fmt->font.name); + if (fmt->font.fallbacks) fmt2->font.fallbacks = strdup(fmt->font.fallbacks); + if (fmt->font.source) fmt2->font.source = strdup(fmt->font.source); if ((fmt2->font.name) && (fmt2->font.fallbacks)) { @@ -1808,7 +1823,7 @@ Evas_Object_Textblock_Format_Item *fi; fi = calloc(1, sizeof(Evas_Object_Textblock_Format_Item)); - fi->item = evas_stringshare_add(item); + fi->item = strdup(item); fi->source_node = n; c->ln->format_items = evas_object_list_append(c->ln->format_items, fi); return fi; ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs