From 86821f881ec2e1e2747561c50dd8446f960ab85d Mon Sep 17 00:00:00 2001 From: tsauerbeck Date: Sun, 1 May 2005 10:30:16 +0000 Subject: [PATCH] use getsarg() SVN revision: 14522 --- legacy/edje/data/src/e_logo.edc | 2 +- legacy/edje/data/src/edje_test.edc | 36 +++++------------------------- legacy/edje/data/src/test.edc | 2 +- legacy/embryo/examples/test.sma | 6 +---- 4 files changed, 9 insertions(+), 37 deletions(-) diff --git a/legacy/edje/data/src/e_logo.edc b/legacy/edje/data/src/e_logo.edc index 335297fb8f..5bfb97f14a 100644 --- a/legacy/edje/data/src/e_logo.edc +++ b/legacy/edje/data/src/e_logo.edc @@ -178,7 +178,7 @@ collections { new buf[100]; snprintf(buf, sizeof(buf), "MESSAGE STRING ID: %i", id); - snprintf(str, sizeof(str), "%s", getarg (2)); + getsarg(2, str, sizeof(str)); emit(buf, str); } else if (type == MSG_INT_SET) diff --git a/legacy/edje/data/src/edje_test.edc b/legacy/edje/data/src/edje_test.edc index 3a35e49db0..54266715af 100644 --- a/legacy/edje/data/src/edje_test.edc +++ b/legacy/edje/data/src/edje_test.edc @@ -25,11 +25,7 @@ collections { new buf[100]; snprintf(buf, sizeof(buf), "MESSAGE STRING ID: %i", id); - for (new j = 0; j < (sizeof(str) - 1); j++) - { - str[j] = getarg(2, j); - if (str[j] == 0) break; - } + getsarg(2, str, sizeof(str)); emit(buf, str); send_message(type, id + 1000, "A Test Reply"); } @@ -65,11 +61,7 @@ collections { snprintf(buf, sizeof(buf), "MESSAGE STRING SET ID: %i", id); for (new i = 2; i < numargs(); i++) { - for (new j = 0; j < (sizeof(str) - 1); j++) - { - str[j] = getarg(i, j); - if (str[j] == 0) break; - } + getsarg(i, str, sizeof(str)); emit(buf, str); } send_message(type, id + 1000, "Alpha", "Beta", "Gamma", "Delta"); @@ -113,11 +105,7 @@ collections { new val; snprintf(buf, sizeof(buf), "MESSAGE STRING INT ID: %i", id); - for (new j = 0; j < (sizeof(str) - 1); j++) - { - str[j] = getarg(2, j); - if (str[j] == 0) break; - } + getsarg(2, str, sizeof(str)); emit(buf, str); val = getarg(3); snprintf(str, sizeof(str), "V = %i", val); @@ -131,11 +119,7 @@ collections { new Float:val; snprintf(buf, sizeof(buf), "MESSAGE STRING INT ID: %i", id); - for (new j = 0; j < (sizeof(str) - 1); j++) - { - str[j] = getarg(2, j); - if (str[j] == 0) break; - } + getsarg(2, str, sizeof(str)); emit(buf, str); val = getfarg(3); snprintf(str, sizeof(str), "V = %f", val); @@ -149,11 +133,7 @@ collections { new val; snprintf(buf, sizeof(buf), "MESSAGE STRING INT SET ID: %i", id); - for (new j = 0; j < (sizeof(str) - 1); j++) - { - str[j] = getarg(2, j); - if (str[j] == 0) break; - } + getsarg(2, str, sizeof(str)); emit(buf, str); for (new i = 3; i < numargs(); i++) { @@ -170,11 +150,7 @@ collections { new Float:val; snprintf(buf, sizeof(buf), "MESSAGE STRING INT SET ID: %i", id); - for (new j = 0; j < (sizeof(str) - 1); j++) - { - str[j] = getarg(2, j); - if (str[j] == 0) break; - } + getsarg(2, str, sizeof(str)); emit(buf, str); for (new i = 3; i < numargs(); i++) { diff --git a/legacy/edje/data/src/test.edc b/legacy/edje/data/src/test.edc index 78c6f7030b..c5cdec2b9a 100644 --- a/legacy/edje/data/src/test.edc +++ b/legacy/edje/data/src/test.edc @@ -80,7 +80,7 @@ collections new buf[100]; snprintf(buf, sizeof(buf), "MESSAGE STRING ID: %i", id); - snprintf(str, 100, "%s", getarg(2)); + getsarg(2, str, 100); emit(buf, str); } else if (type == MSG_INT_SET) diff --git a/legacy/embryo/examples/test.sma b/legacy/embryo/examples/test.sma index 06853dbc4c..0bd1ea1a54 100644 --- a/legacy/embryo/examples/test.sma +++ b/legacy/embryo/examples/test.sma @@ -131,11 +131,7 @@ vargs(a, b, ...) printf(" GET ARG... %i\n", i); if (i < 4) { - for (new j = 0; j < (sizeof(str) - 1); j++) - { - str[j] = getarg(i, j); - if (str[j] == 0) break; - } + getsarg(i, str, sizeof(str)); printf(" ARG: %s [max %i]\n", str, sizeof(str)); } else if (i < 6)