diff options
author | Ezequiel Garcia <elezegarcia@gmail.com> | 2013-06-11 10:16:53 -0300 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2013-06-12 09:25:48 +1000 |
commit | ace9784ea7b9d52e711dc8e4f37c27a282d545a8 (patch) | |
tree | e963d12622e2866b0df3491088c749d39d976df6 /examples.api | |
parent | eb578b74a976d3f67ecd08df8cabe4e86074e72f (diff) | |
download | jimtcl-ace9784ea7b9d52e711dc8e4f37c27a282d545a8.zip jimtcl-ace9784ea7b9d52e711dc8e4f37c27a282d545a8.tar.gz jimtcl-ace9784ea7b9d52e711dc8e4f37c27a282d545a8.tar.bz2 |
example.api: Replace string object initialization
The object initialization relies on the API function:
Jim_InitStringRep(), yet this function has been removed
by this commit.
commit 2e8b9ddb92ed1cea3054ed8180d363c9dcc72dd9
Author: Steve Bennett <steveb@workware.net.au>
Date: Sat Feb 18 14:47:11 2012 +1000
Small cleanup/optimisation in object create/dup
(BTW, it's not very clean to remove an API function and
not even specify that in the commit message).
Signed-off-by: Ezequiel Garcia <elezegarcia@gmail.com>
Diffstat (limited to 'examples.api')
-rw-r--r-- | examples.api/jim_obj.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/examples.api/jim_obj.c b/examples.api/jim_obj.c index 607ef7c..91d1e84 100644 --- a/examples.api/jim_obj.c +++ b/examples.api/jim_obj.c @@ -56,12 +56,8 @@ main(int argc, char **argv) /* And initialise any static extensions */ Jim_InitStaticExtensions(interp); - - /* Create some empty object */ - obj = Jim_NewObj(interp); - - /* Name the object */ - Jim_InitStringRep(obj, OBJ_DESC, strlen(OBJ_DESC)) ; + /* Create a string object */ + obj = Jim_NewStringObj(interp, OBJ_DESC, strlen(OBJ_DESC)); /* Obtain internal representation of an object */ obj_desc = Jim_GetString(obj, &obj_size); |