Enlightenment CVS committal

Author  : tsauerbeck
Project : e17
Module  : libs/embryo

Dir     : e17/libs/embryo/src/bin


Modified Files:
        embryo_cc_sc.h embryo_cc_sc1.c embryo_cc_sc2.c 
        embryo_cc_sclist.c 


Log Message:
removed duplicatestring(), which was horribly broken and pretty useless
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/bin/embryo_cc_sc.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- embryo_cc_sc.h      13 Apr 2005 19:38:53 -0000      1.13
+++ embryo_cc_sc.h      13 Apr 2005 20:27:02 -0000      1.14
@@ -9,7 +9,7 @@
  *  Copyright J.E. Hendrix, 1982, 1983
  *  Copyright T. Riemersma, 1997-2003
  *
- *  Version: $Id: embryo_cc_sc.h,v 1.13 2005/04/13 19:38:53 tsauerbeck Exp $
+ *  Version: $Id: embryo_cc_sc.h,v 1.14 2005/04/13 20:27:02 tsauerbeck Exp $
  *
  *  This software is provided "as-is", without any express or implied warranty.
  *  In no event will the authors be held liable for any damages arising from
@@ -586,7 +586,6 @@
 int         phopt_cleanup(void);
 
 /* function prototypes in SCLIST.C */
-char       *duplicatestring(const char *sourcestring);
 stringpair *insert_alias(char *name, char *alias);
 stringpair *find_alias(char *name);
 int         lookup_alias(char *target, char *name);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/bin/embryo_cc_sc1.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -3 -r1.29 -r1.30
--- embryo_cc_sc1.c     13 Apr 2005 20:01:17 -0000      1.29
+++ embryo_cc_sc1.c     13 Apr 2005 20:27:02 -0000      1.30
@@ -21,7 +21,7 @@
  *  must not be misrepresented as being the original software.
  *  3.  This notice may not be removed or altered from any source
  *  distribution.  
- *  Version: $Id: embryo_cc_sc1.c,v 1.29 2005/04/13 20:01:17 tsauerbeck Exp $
+ *  Version: $Id: embryo_cc_sc1.c,v 1.30 2005/04/13 20:27:02 tsauerbeck Exp $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -2727,7 +2727,7 @@
 
                       tokeninfo(&val, &name);
                       if ((arg->defvalue.size.symname =
-                           duplicatestring(name)) == NULL)
+                           strdup(name)) == NULL)
                          error(103);   /* insufficient memory */
                       arg->defvalue.size.level = 0;
                       if (size_tag_token == uSIZEOF)
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/bin/embryo_cc_sc2.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- embryo_cc_sc2.c     13 Apr 2005 20:01:19 -0000      1.19
+++ embryo_cc_sc2.c     13 Apr 2005 20:27:03 -0000      1.20
@@ -21,7 +21,7 @@
  *      misrepresented as being the original software.
  *  3.  This notice may not be removed or altered from any source distribution.
  *
- *  Version: $Id: embryo_cc_sc2.c,v 1.19 2005/04/13 20:01:19 tsauerbeck Exp $
+ *  Version: $Id: embryo_cc_sc2.c,v 1.20 2005/04/13 20:27:03 tsauerbeck Exp $
  */
 
 #ifdef HAVE_CONFIG_H
@@ -122,7 +122,7 @@
    pushstk((stkitem) fcurrent);
    /* FIXME: 64bit unsafe */
    pushstk((stkitem) fline);
-   inpfname = duplicatestring(name);   /* set name of include file */
+   inpfname = strdup(name);    /* set name of include file */
    if (inpfname == NULL)
       error(103);              /* insufficient memory */
    inpf = fp;                  /* set input file pointer to include file */
@@ -934,7 +934,7 @@
             if (strlen(pathname) > 0)
               {
                  free(inpfname);
-                 inpfname = duplicatestring(pathname);
+                 inpfname = strdup(pathname);
                  if (inpfname == NULL)
                     error(103);        /* insufficient memory */
               }                /* if */
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/embryo/src/bin/embryo_cc_sclist.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- embryo_cc_sclist.c  11 Jul 2004 09:50:42 -0000      1.3
+++ embryo_cc_sclist.c  13 Apr 2005 20:27:03 -0000      1.4
@@ -21,26 +21,13 @@
  *      misrepresented as being the original software.
  *  3.  This notice may not be removed or altered from any source distribution.
  *
- *  Version: $Id: embryo_cc_sclist.c,v 1.3 2004/07/11 09:50:42 tsauerbeck Exp $
+ *  Version: $Id: embryo_cc_sclist.c,v 1.4 2005/04/13 20:27:03 tsauerbeck Exp $
  */
 #include <assert.h>
 #include <stdlib.h>
 #include <string.h>
 #include "embryo_cc_sc.h"
 
-/* a "private" implementation of strdup(), so that porting
- * to other memory allocators becomes easier.
- * By S�ren Hannibal.
- */
-char       *
-duplicatestring(const char *sourcestring)
-{
-   char               *result = malloc(strlen(sourcestring) + 1);
-
-   strcpy(result, sourcestring);
-   return result;
-}
-
 static stringpair  *
 insert_stringpair(stringpair * root, char *first, char *second, int 
matchlength)
 {
@@ -52,8 +39,8 @@
    /* create a new node, and check whether all is okay */
    if ((cur = (stringpair *) malloc(sizeof(stringpair))) == NULL)
       return NULL;
-   cur->first = duplicatestring(first);
-   cur->second = duplicatestring(second);
+   cur->first = strdup(first);
+   cur->second = strdup(second);
    cur->matchlength = matchlength;
    if (cur->first == NULL || cur->second == NULL)
      {
@@ -191,7 +178,7 @@
    assert(path != NULL);
    if ((cur = (stringlist *) malloc(sizeof(stringlist))) == NULL)
       error(103);              /* insufficient memory (fatal error) */
-   if ((cur->line = duplicatestring(path)) == NULL)
+   if ((cur->line = strdup(path)) == NULL)
       error(103);              /* insufficient memory (fatal error) */
    cur->next = includepaths.next;
    includepaths.next = cur;




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to