Enlightenment CVS committal

Author  : mej
Project : eterm
Module  : libast

Dir     : eterm/libast/src


Modified Files:
        options.c regexp.c socket.c strings.c 


Log Message:
Wed Jul 21 22:48:14 2004                        Michael Jennings (mej)

More cleanups and fixed compile problems.
----------------------------------------------------------------------

===================================================================
RCS file: /cvsroot/enlightenment/eterm/libast/src/options.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- options.c   10 Jan 2004 21:15:17 -0000      1.13
+++ options.c   22 Jul 2004 02:49:50 -0000      1.14
@@ -29,11 +29,11 @@
  * option parser.
  *
  * @author Michael Jennings <[EMAIL PROTECTED]>
- * $Revision: 1.13 $
- * $Date: 2004/01/10 21:15:17 $
+ * $Revision: 1.14 $
+ * $Date: 2004/07/22 02:49:50 $
  */
 
-static const char cvs_ident[] = "$Id: options.c,v 1.13 2004/01/10 21:15:17 mej Exp $";
+static const char cvs_ident[] = "$Id: options.c,v 1.14 2004/07/22 02:49:50 mej Exp $";
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
@@ -55,7 +55,7 @@
  */
 
 /** Next argument.  Proceed to parsing the next argument in the argv[] list. */
-#define NEXT_ARG()       D_OPTIONS(("NEXT_ARG()\n")); i++; opt = argv[i]; continue
+#define NEXT_ARG()       D_OPTIONS(("NEXT_ARG()\n")); i++; opt = 
SPIF_CHARPTR(argv[i]); continue
 /** Next letter.  Proceed to the next letter in a bundled option series. */
 #define NEXT_LETTER()    D_OPTIONS(("NEXT_LETTER(%s)\n", opt)); if (*(opt + 1)) 
{opt++;} else {NEXT_ARG();} continue
 /** Next loop.  Proceed to the next parsing stage (letter or word). */
@@ -90,14 +90,14 @@
  * @see @link DOXGRP_OPT Command Line Option Parser @endlink
  * @ingroup DOXGRP_OPT
  */
-static const char *
+static spif_charptr_t 
 get_option_type_string(spif_uint16_t type)
 {
     switch (type) {
-        case SPIFOPT_FLAG_BOOLEAN: return "(bool)"; break;
-        case SPIFOPT_FLAG_INTEGER: return "(int)"; break;
-        case SPIFOPT_FLAG_ARGLIST: return "(strs)"; break;
-        default: return "(str)";
+        case SPIFOPT_FLAG_BOOLEAN: return SPIF_CHARPTR("(bool)"); break;
+        case SPIFOPT_FLAG_INTEGER: return SPIF_CHARPTR("(int)"); break;
+        case SPIFOPT_FLAG_ARGLIST: return SPIF_CHARPTR("(strs)"); break;
+        default: return SPIF_CHARPTR("(str)");
     }
     ASSERT_NOTREACHED_RVAL(NULL);
 }
@@ -160,7 +160,7 @@
             printf("      ");
         }
         printf("--%s", SPIFOPT_OPT_LONG(i));
-        for (col = strlen(SPIFOPT_OPT_LONG(i)); col < l_long; col++) {
+        for (col = strlen(SPIF_CAST_C(char *) SPIFOPT_OPT_LONG(i)); col < l_long; 
col++) {
             printf(" ");
         }
         printf("  %-6s %s\n", get_option_type_string(SPIFOPT_OPT_TYPE(i)), 
SPIFOPT_OPT_DESC(i));
@@ -181,7 +181,7 @@
  * @ingroup DOXGRP_OPT
  */
 static spif_int32_t
-find_long_option(char *opt)
+find_long_option(spif_charptr_t opt)
 {
     spif_int32_t j;
 
@@ -190,9 +190,10 @@
     for (j = 0; j < SPIFOPT_NUMOPTS_GET(); j++) {
         size_t l;
 
-        l = strlen(SPIFOPT_OPT_LONG(j));
+        l = strlen(SPIF_CHARPTR_C(SPIFOPT_OPT_LONG(j)));
         /* Look for matches to the part before the =, if any. */
-        if (!strncasecmp(SPIFOPT_OPT_LONG(j), opt, l) && (opt[l] == '=' || !opt[l])) {
+        if (!strncasecmp(SPIF_CHARPTR_C(SPIFOPT_OPT_LONG(j)), SPIF_CHARPTR_C(opt), l)
+            && (opt[l] == '=' || !opt[l])) {
             /* Got one. */
             D_OPTIONS(("Match found at %d:  %s == %s\n", j, SPIFOPT_OPT_LONG(j), 
opt));
             return j;
@@ -251,12 +252,12 @@
  * @see @link DOXGRP_OPT Command Line Option Parser @endlink, spifopt_parse()
  * @ingroup DOXGRP_OPT
  */
-static char *
-find_value_long(char *arg, char *next_arg, unsigned char *hasequal)
+static spif_charptr_t 
+find_value_long(spif_charptr_t arg, spif_charptr_t next_arg, spif_charptr_t hasequal)
 {
-    char *val_ptr;
+    spif_charptr_t val_ptr;
 
-    if ((val_ptr = strchr(arg, '=')) != NULL) {
+    if ((val_ptr = SPIF_CHARPTR(strchr(SPIF_CHARPTR_C(arg), '='))) != NULL) {
         val_ptr++;
         *hasequal = 1;
     } else {
@@ -283,10 +284,10 @@
  * @see @link DOXGRP_OPT Command Line Option Parser @endlink, spifopt_parse()
  * @ingroup DOXGRP_OPT
  */
-static char *
-find_value_short(char *arg, char *next_arg)
+static spif_charptr_t 
+find_value_short(spif_charptr_t arg, spif_charptr_t next_arg)
 {
-    char *val_ptr = NULL;
+    spif_charptr_t val_ptr = NULL;
 
     if (arg[1]) {
         val_ptr = arg + 1;
@@ -310,7 +311,7 @@
  * @ingroup DOXGRP_OPT
  */
 static spif_bool_t
-is_boolean_value(char *val_ptr)
+is_boolean_value(spif_charptr_t val_ptr)
 {
     if (!(val_ptr) || !(*val_ptr)) {
         return FALSE;
@@ -332,7 +333,7 @@
  * @ingroup DOXGRP_OPT
  */
 static spif_bool_t
-is_valid_option(char *opt)
+is_valid_option(spif_charptr_t opt)
 {
     REQUIRE_RVAL(opt != NULL, FALSE);
 
@@ -371,7 +372,7 @@
  * @ingroup DOXGRP_OPT
  */
 static spif_bool_t
-handle_boolean(spif_int32_t n, char *val_ptr, unsigned char islong)
+handle_boolean(spif_int32_t n, spif_charptr_t val_ptr, unsigned char islong)
 {
     D_OPTIONS(("Boolean option detected\n"));
     if (val_ptr && islong) {
@@ -423,10 +424,10 @@
  * @ingroup DOXGRP_OPT
  */
 static void
-handle_integer(spif_int32_t n, char *val_ptr)
+handle_integer(spif_int32_t n, spif_charptr_t val_ptr)
 {
     D_OPTIONS(("Integer option detected\n"));
-    *((int *) SPIFOPT_OPT_VALUE(n)) = strtol(val_ptr, (char **) NULL, 0);
+    *((int *) SPIFOPT_OPT_VALUE(n)) = strtol(SPIF_CHARPTR_C(val_ptr), (char **) NULL, 
0);
 }
 
 /**
@@ -444,10 +445,10 @@
  * @ingroup DOXGRP_OPT
  */
 static void
-handle_string(spif_int32_t n, char *val_ptr)
+handle_string(spif_int32_t n, spif_charptr_t val_ptr)
 {
     D_OPTIONS(("String option detected\n"));
-    *((const char **) SPIFOPT_OPT_VALUE(n)) = STRDUP(val_ptr);
+    *((const char **) SPIFOPT_OPT_VALUE(n)) = SPIF_CAST_C(char *) STRDUP(val_ptr);
 }
 
 
@@ -470,36 +471,36 @@
  * @ingroup DOXGRP_OPT
  */
 static void
-handle_arglist(spif_int32_t n, char *val_ptr, unsigned char hasequal,
+handle_arglist(spif_int32_t n, spif_charptr_t val_ptr, unsigned char hasequal,
                spif_int32_t i, int argc, char *argv[])
 {
-    char **tmp;
+    spif_charptr_t *tmp;
     register unsigned short k;
 
     D_OPTIONS(("Argument list option detected\n"));
     if (hasequal) {
         /* There's an equals sign, so just parse the rest of this option into words. 
*/
-        tmp = (char **) MALLOC(sizeof(char *) * (spiftool_num_words(val_ptr) + 1));
+        tmp = SPIF_CAST_PTR(charptr) MALLOC(sizeof(spif_charptr_t) * 
(spiftool_num_words(val_ptr) + 1));
 
         for (k = 0; val_ptr; k++) {
             tmp[k] = spiftool_get_word(1, val_ptr);
             val_ptr = spiftool_get_pword(2, val_ptr);
             D_OPTIONS(("tmp[%d] == %s\n", k, tmp[k]));
         }
-        tmp[k] = (char *) NULL;
-        *((char ***) SPIFOPT_OPT_VALUE(n)) = tmp;
+        tmp[k] = SPIF_NULL_TYPE(charptr);
+        *(SPIF_CAST_C(spif_charptr_t **) SPIFOPT_OPT_VALUE(n)) = tmp;
     } else {
         unsigned short len = argc - i;
 
         /* No equals sign, so use the rest of the command line and break. */
-        tmp = (char **) MALLOC(sizeof(char *) * (argc - i + 1));
+        tmp = SPIF_CAST_PTR(charptr) MALLOC(sizeof(spif_charptr_t ) * (argc - i + 1));
 
         for (k = 0; k < len; k++) {
-            tmp[k] = STRDUP(argv[k + i]);
+            tmp[k] = SPIF_CAST(charptr) STRDUP(argv[k + i]);
             D_OPTIONS(("tmp[%d] == %s\n", k, tmp[k]));
         }
-        tmp[k] = (char *) NULL;
-        *((char ***) SPIFOPT_OPT_VALUE(n)) = tmp;
+        tmp[k] = SPIF_NULL_TYPE(charptr);
+        *(SPIF_CAST_C(spif_charptr_t **) SPIFOPT_OPT_VALUE(n)) = tmp;
     }
 }
 
@@ -520,19 +521,19 @@
 spifopt_parse(int argc, char *argv[])
 {
     spif_int32_t i, j;
-    char *opt;
+    spif_charptr_t opt;
 
     REQUIRE(argc > 1);
     REQUIRE(argv != NULL);
 
     /* Process each command line arg one-by-one. */
-    for (i = 1, opt = argv[1]; i < argc; ) {
-        char *val_ptr = NULL;
-        unsigned char islong = 0, hasequal = 0;
+    for (i = 1, opt = SPIF_CHARPTR(argv[1]); i < argc; ) {
+        spif_charptr_t val_ptr = NULL;
+        spif_char_t islong = 0, hasequal = 0;
 
         D_OPTIONS(("argv[%d] == \"%s\", opt == \"%s\"\n", i, argv[i], opt));
 
-        if (opt == argv[i]) {
+        if (opt == SPIF_CHARPTR(argv[i])) {
             /* If it's not an option, skip it. */
             if (*opt != '-') {
                 NEXT_ARG();
@@ -558,9 +559,9 @@
 
         /* If a value was passed to this option, set val_ptr to point to it. */
         if (islong) {
-            val_ptr = find_value_long(argv[i], argv[i + 1], &hasequal);
+            val_ptr = find_value_long(SPIF_CHARPTR(argv[i]), SPIF_CHARPTR(argv[i + 
1]), &hasequal);
         } else {
-            val_ptr = find_value_short(opt, argv[i + 1]);
+            val_ptr = find_value_short(opt, SPIF_CHARPTR(argv[i + 1]));
         }
 
         /* Boolean options may or may not have a value... */
@@ -572,9 +573,9 @@
             }
         }
         if (val_ptr) {
-            if (val_ptr == argv[i + 1]) {
+            if (val_ptr == SPIF_CHARPTR(argv[i + 1])) {
                 i++;
-                opt += strlen(opt);
+                opt += strlen(SPIF_CHARPTR_C(opt));
             }
         }
 
@@ -582,17 +583,17 @@
         if (SPIFOPT_OPT_IS_DEPRECATED(j)) {
             spif_str_t warn;
 
-            warn = spif_str_new_from_buff("The ", 128);
+            warn = spif_str_new_from_buff(SPIF_CHARPTR("The "), 128);
             if (SPIFOPT_OPT_SHORT(j)) {
                 spif_str_append_char(warn, '-');
                 spif_str_append_char(warn, SPIFOPT_OPT_SHORT(j));
-                spif_str_append_from_ptr(warn, " / --");
+                spif_str_append_from_ptr(warn, SPIF_CHARPTR(" / --"));
             } else {
-                spif_str_append_from_ptr(warn, "--");
+                spif_str_append_from_ptr(warn, SPIF_CHARPTR("--"));
             }
             spif_str_append_from_ptr(warn, SPIFOPT_OPT_LONG(j));
-            spif_str_append_from_ptr(warn, " option is deprecated and should not be 
used.\n");
-            libast_print_warning(SPIF_STR_STR(warn));
+            spif_str_append_from_ptr(warn, SPIF_CHARPTR(" option is deprecated and 
should not be used.\n"));
+            libast_print_warning(SPIF_CHARPTR_C(SPIF_STR_STR(warn)));
             spif_str_del(warn);
         }
 
===================================================================
RCS file: /cvsroot/enlightenment/eterm/libast/src/regexp.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -3 -r1.13 -r1.14
--- regexp.c    20 Jul 2004 22:32:08 -0000      1.13
+++ regexp.c    22 Jul 2004 02:49:50 -0000      1.14
@@ -21,7 +21,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-static const char cvs_ident[] = "$Id: regexp.c,v 1.13 2004/07/20 22:32:08 mej Exp $";
+static const char cvs_ident[] = "$Id: regexp.c,v 1.14 2004/07/22 02:49:50 mej Exp $";
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
@@ -105,7 +105,7 @@
     }
     spif_obj_set_class(SPIF_OBJ(self), SPIF_CLASS_VAR(regexp));
     self->data = SPIF_NULL_TYPE(ptr);
-    spif_regexp_set_flags(self, "");
+    spif_regexp_set_flags(self, SPIF_CHARPTR(""));
     return TRUE;
 }
 
@@ -118,7 +118,7 @@
     }
     spif_obj_set_class(SPIF_OBJ(self), SPIF_CLASS_VAR(regexp));
     self->data = SPIF_NULL_TYPE(ptr);
-    spif_regexp_set_flags(self, "");
+    spif_regexp_set_flags(self, SPIF_CHARPTR(""));
     return TRUE;
 }
 
@@ -154,14 +154,16 @@
     }
 
     memset(tmp, ' ', indent);
-    snprintf(tmp + indent, sizeof(tmp) - indent, "(spif_regexp_t) %s:  %10p {\n", 
name, self);
+    snprintf(SPIF_CHARPTR_C(tmp) + indent, sizeof(tmp) - indent,
+             "(spif_regexp_t) %s:  %10p {\n",
+             name, SPIF_CAST(ptr) self);
     if (SPIF_REGEXP_ISNULL(buff)) {
         buff = spif_str_new_from_ptr(tmp);
     } else {
         spif_str_append_from_ptr(buff, tmp);
     }
 
-    snprintf(tmp, sizeof(tmp), "}\n");
+    snprintf(SPIF_CHARPTR_C(tmp), sizeof(tmp), "}\n");
     spif_str_append_from_ptr(buff, tmp);
     return buff;
 }
@@ -205,9 +207,11 @@
         const char *errptr;
         int erroffset;
 
-        self->data = SPIF_CAST(ptr) pcre_compile(SPIF_STR_STR(SPIF_STR(self)), 
self->flags, &errptr, &erroffset, NULL);
-        if (self->data == SPIF_NULL_TYPE(ptr)) {
-            libast_print_error("PCRE compilation of \"%s\" failed at offset %d -- 
%s\n", SPIF_STR_STR(SPIF_STR(self)), erroffset, errptr);
+        self->data = SPIF_CAST(ptr) 
pcre_compile(SPIF_CHARPTR_C(SPIF_STR_STR(SPIF_STR(self))),
+                                                 self->flags, &errptr, &erroffset, 
NULL);
+        if (SPIF_PTR_ISNULL(self->data)) {
+            libast_print_error("PCRE compilation of \"%s\" failed at offset %d -- 
%s\n",
+                               SPIF_STR_STR(SPIF_STR(self)), erroffset, errptr);
             return FALSE;
         }
         return TRUE;
@@ -241,7 +245,7 @@
     {
         int rc;
 
-        rc = pcre_exec(SPIF_CAST_C(pcre *) self->data, NULL, SPIF_STR_STR(subject),
+        rc = pcre_exec(SPIF_CAST_C(pcre *) self->data, NULL, 
SPIF_CHARPTR_C(SPIF_STR_STR(subject)),
                        spif_str_get_len(subject), 0, 0, NULL, 0);
         if (rc == 0) {
             return TRUE;
@@ -292,8 +296,8 @@
     {
         int rc;
 
-        rc = pcre_exec(SPIF_CAST_C(pcre *) self->data, NULL, subject,
-                       strlen(subject), 0, 0, NULL, 0);
+        rc = pcre_exec(SPIF_CAST_C(pcre *) self->data, NULL, SPIF_CHARPTR_C(subject),
+                       strlen(SPIF_CHARPTR_C(subject)), 0, 0, NULL, 0);
         if (rc == 0) {
             return TRUE;
         } else if (rc == PCRE_ERROR_NOMATCH) {
===================================================================
RCS file: /cvsroot/enlightenment/eterm/libast/src/socket.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -3 -r1.21 -r1.22
--- socket.c    20 Jul 2004 22:32:08 -0000      1.21
+++ socket.c    22 Jul 2004 02:49:50 -0000      1.22
@@ -21,7 +21,7 @@
  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  */
 
-static const char cvs_ident[] = "$Id: socket.c,v 1.21 2004/07/20 22:32:08 mej Exp $";
+static const char cvs_ident[] = "$Id: socket.c,v 1.22 2004/07/22 02:49:50 mej Exp $";
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
@@ -170,7 +170,9 @@
     }
         
     memset(tmp, ' ', indent);
-    snprintf(tmp + indent, sizeof(tmp) - indent, "(spif_socket_t) %s:  %10p {\n", 
name, self);
+    snprintf(SPIF_CHARPTR_C(tmp) + indent, sizeof(tmp) - indent,
+             "(spif_socket_t) %s:  %10p {\n",
+             name, SPIF_CAST(ptr) self);
     if (SPIF_STR_ISNULL(buff)) {
         buff = spif_str_new_from_ptr(tmp);
     } else {
@@ -179,32 +181,32 @@
 
     indent += 2;
     memset(tmp, ' ', indent);
-    snprintf(tmp + indent, sizeof(tmp) - indent, "(spif_sockfd_t) fd:  %d\n", 
self->fd);
+    snprintf(SPIF_CHARPTR_C(tmp) + indent, sizeof(tmp) - indent, "(spif_sockfd_t) fd: 
 %d\n", self->fd);
     spif_str_append_from_ptr(buff, tmp);
 
-    snprintf(tmp + indent, sizeof(tmp) - indent, "(spif_sockfamily_t) fam:  %d\n", 
(int) self->fam);
+    snprintf(SPIF_CHARPTR_C(tmp) + indent, sizeof(tmp) - indent, "(spif_sockfamily_t) 
fam:  %d\n", (int) self->fam);
     spif_str_append_from_ptr(buff, tmp);
 
-    snprintf(tmp + indent, sizeof(tmp) - indent, "(spif_socktype_t) type:  %d\n", 
(int) self->type);
+    snprintf(SPIF_CHARPTR_C(tmp) + indent, sizeof(tmp) - indent, "(spif_socktype_t) 
type:  %d\n", (int) self->type);
     spif_str_append_from_ptr(buff, tmp);
 
-    snprintf(tmp + indent, sizeof(tmp) - indent, "(spif_sockproto_t) proto:  %d\n", 
(int) self->proto);
+    snprintf(SPIF_CHARPTR_C(tmp) + indent, sizeof(tmp) - indent, "(spif_sockproto_t) 
proto:  %d\n", (int) self->proto);
     spif_str_append_from_ptr(buff, tmp);
 
-    snprintf(tmp + indent, sizeof(tmp) - indent, "(spif_sockaddr_t) addr:  %10p\n", 
self->addr);
+    snprintf(SPIF_CHARPTR_C(tmp) + indent, sizeof(tmp) - indent, "(spif_sockaddr_t) 
addr:  %10p\n", SPIF_CAST(ptr) self->addr);
     spif_str_append_from_ptr(buff, tmp);
 
-    snprintf(tmp + indent, sizeof(tmp) - indent, "(spif_sockaddr_len_t) len:  %lu\n", 
(unsigned long) self->len);
+    snprintf(SPIF_CHARPTR_C(tmp) + indent, sizeof(tmp) - indent, 
"(spif_sockaddr_len_t) len:  %lu\n", (unsigned long) self->len);
     spif_str_append_from_ptr(buff, tmp);
 
-    snprintf(tmp + indent, sizeof(tmp) - indent, "(spif_uint32_t) flags:  0x%08x\n", 
(unsigned) self->flags);
+    snprintf(SPIF_CHARPTR_C(tmp) + indent, sizeof(tmp) - indent, "(spif_uint32_t) 
flags:  0x%08x\n", (unsigned) self->flags);
     spif_str_append_from_ptr(buff, tmp);
 
-    spif_url_show(self->local_url, "local_url", buff, indent);
-    spif_url_show(self->remote_url, "remote_url", buff, indent);
+    spif_url_show(self->local_url, SPIF_CHARPTR("local_url"), buff, indent);
+    spif_url_show(self->remote_url, SPIF_CHARPTR("remote_url"), buff, indent);
 
     indent -= 2;
-    snprintf(tmp + indent, sizeof(tmp) - indent, "}\n");
+    snprintf(SPIF_CHARPTR_C(tmp) + indent, sizeof(tmp) - indent, "}\n");
     spif_str_append_from_ptr(buff, tmp);
 
     return buff;
@@ -482,10 +484,10 @@
                 {
                     spif_bool_t b;
                     spif_str_t tmp_buf;
-                    char *s;
+                    spif_charptr_t s;
                     long left;
 
-                    for (left = len, s = SPIF_STR_STR(data); left > 0; s += 1024, 
left -= 1024) {
+                    for (left = len, s = SPIF_CHARPTR(SPIF_STR_STR(data)); left > 0; 
s += 1024, left -= 1024) {
                         tmp_buf = spif_str_new_from_buff(s, 1024);
                         b = spif_socket_send(self, tmp_buf);
                         if (b == FALSE) {
@@ -651,12 +653,12 @@
         hinfo = gethostbyaddr(SPIF_CONST_CAST_C(char *) &(ipaddr->sin_addr), 
sizeof(ipaddr->sin_addr), AF_INET);
     } while ((tries <= 3) && (hinfo == NULL) && (h_errno == TRY_AGAIN));
     if (hinfo == NULL || hinfo->h_name == NULL) {
-        char *buff;
+        spif_charptr_t buff;
 
-        buff = inet_ntoa(ipaddr->sin_addr);
+        buff = SPIF_CHARPTR(inet_ntoa(ipaddr->sin_addr));
         self->host = spif_str_new_from_ptr(buff);
     } else {
-        self->host = spif_str_new_from_ptr(hinfo->h_name);
+        self->host = spif_str_new_from_ptr(SPIF_CHARPTR(hinfo->h_name));
     }
 
     self->port = spif_str_new_from_num(ntohs(ipaddr->sin_port));
@@ -690,7 +692,7 @@
     self->query = SPIF_NULL_TYPE(str);
 
     if (unixaddr->sun_path != NULL) {
-        self->path = spif_str_new_from_ptr(unixaddr->sun_path);
+        self->path = spif_str_new_from_ptr(SPIF_CHARPTR(unixaddr->sun_path));
     } else {
         self->path = SPIF_NULL_TYPE(str);
     }
@@ -716,7 +718,7 @@
     tries = 0;
     do {
         tries++;
-        hinfo = gethostbyname(SPIF_STR_STR(hostname));
+        hinfo = gethostbyname(SPIF_CHARPTR_C(SPIF_STR_STR(hostname)));
     } while ((tries <= 3) && (hinfo == NULL) && (h_errno == TRY_AGAIN));
     if (hinfo == NULL) {
         libast_print_error("Unable to resolve hostname \"%s\" -- %s\n", 
SPIF_STR_STR(hostname), hstrerror(h_errno));
@@ -749,7 +751,7 @@
     addr = SPIF_ALLOC(unixsockaddr);
     addr->sun_family = AF_UNIX;
     addr->sun_path[0] = 0;
-    strncat(addr->sun_path, SPIF_STR_STR(spif_url_get_path(self)), 
sizeof(addr->sun_path) - 1);
+    strncat(addr->sun_path, SPIF_CHARPTR_C(SPIF_STR_STR(spif_url_get_path(self))), 
sizeof(addr->sun_path) - 1);
     return addr;
 }
 
@@ -785,7 +787,7 @@
 
     proto_str = spif_url_get_proto(url);
     if (!SPIF_STR_ISNULL(proto_str)) {
-        if (SPIF_CMP_IS_EQUAL(spif_str_cmp_with_ptr(proto_str, "raw"))) {
+        if (SPIF_CMP_IS_EQUAL(spif_str_cmp_with_ptr(proto_str, SPIF_CHARPTR("raw")))) 
{
             spif_str_t target;
 
             /* Raw socket.  Could be raw UNIX or raw IP. */
@@ -801,19 +803,19 @@
             } else {
                 SPIF_SOCKET_FLAGS_SET(self, SPIF_SOCKET_FLAGS_FAMILY_INET);
             }
-        } else if (SPIF_CMP_IS_EQUAL(spif_str_cmp_with_ptr(proto_str, "unix"))) {
+        } else if (SPIF_CMP_IS_EQUAL(spif_str_cmp_with_ptr(proto_str, 
SPIF_CHARPTR("unix")))) {
             /* UNIX socket.  Assume stream-based. */
             SPIF_SOCKET_FLAGS_SET(self, SPIF_SOCKET_FLAGS_FAMILY_UNIX);
             SPIF_SOCKET_FLAGS_SET(self, SPIF_SOCKET_FLAGS_TYPE_STREAM);
         } else {
             /* IP socket.  See if they gave us a protocol name. */
             SPIF_SOCKET_FLAGS_SET(self, SPIF_SOCKET_FLAGS_FAMILY_INET);
-            proto = getprotobyname(SPIF_STR_STR(proto_str));
+            proto = getprotobyname(SPIF_CHARPTR_C(SPIF_STR_STR(proto_str)));
             if (proto == NULL) {
                 /* If it's not a protocol, it's probably a service. */
-                serv = getservbyname(SPIF_STR_STR(proto_str), "tcp");
+                serv = getservbyname(SPIF_CHARPTR_C(SPIF_STR_STR(proto_str)), "tcp");
                 if (serv == NULL) {
-                    serv = getservbyname(SPIF_STR_STR(proto_str), "udp");
+                    serv = getservbyname(SPIF_CHARPTR_C(SPIF_STR_STR(proto_str)), 
"udp");
                 }
                 if (serv != NULL) {
                     /* If we found one, get the protocol info too. */
===================================================================
RCS file: /cvsroot/enlightenment/eterm/libast/src/strings.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -3 -r1.22 -r1.23
--- strings.c   20 Jul 2004 22:32:08 -0000      1.22
+++ strings.c   22 Jul 2004 02:49:50 -0000      1.23
@@ -30,7 +30,7 @@
  * @author Michael Jennings <[EMAIL PROTECTED]>
  */
 
-static const char cvs_ident[] = "$Id: strings.c,v 1.22 2004/07/20 22:32:08 mej Exp $";
+static const char cvs_ident[] = "$Id: strings.c,v 1.23 2004/07/22 02:49:50 mej Exp $";
 
 #ifdef HAVE_CONFIG_H
 # include <config.h>
@@ -349,7 +349,7 @@
 spiftool_split(const spif_charptr_t delim, const spif_charptr_t str)
 {
     spif_charptr_t *slist;
-    register const spif_charptr_t pstr;
+    register spif_charptr_t pstr;
     register spif_charptr_t pdest;
     char quote = 0;
     unsigned short cnt = 0;
@@ -357,20 +357,20 @@
 
     REQUIRE_RVAL(str != NULL, (spif_charptr_t *) NULL);
 
-    if ((slist = (spif_charptr_t *) MALLOC(sizeofSPIF_CAST(charptr))) == NULL) {
+    if ((slist = (spif_charptr_t *) MALLOC(sizeof(spif_charptr_t))) == NULL) {
         libast_print_error("split():  Unable to allocate memory -- %s\n", 
strerror(errno));
         return ((spif_charptr_t *) NULL);
     }
 
     /* Before we do anything, skip leading "whitespace." */
-    for (pstr = str; *pstr && IS_DELIM(*pstr); pstr++);
+    for (pstr = SPIF_CAST(charptr) str; *pstr && IS_DELIM(*pstr); pstr++);
 
     /* The outermost for loop is where we traverse the string.  Each new
        word brings us back to the top where we resize our string list. */
     for (; *pstr; cnt++) {
         /* First, resize the list to two bigger than our count.  Why two?
            One for the string we're about to do, and one for a trailing NULL. */
-        if ((slist = (spif_charptr_t *) REALLOC(slist, sizeofSPIF_CAST(charptr) * 
(cnt + 2))) == NULL) {
+        if ((slist = (spif_charptr_t *) REALLOC(slist, sizeof(spif_charptr_t) * (cnt 
+ 2))) == NULL) {
             libast_print_error("split():  Unable to allocate memory -- %s\n", 
strerror(errno));
             return ((spif_charptr_t *) NULL);
         }
@@ -437,7 +437,7 @@
 }
 
 spif_charptr_t 
-spiftool_join(const spif_charptr_t sep, spif_charptr_t *slist)
+spiftool_join(spif_charptr_t sep, spif_charptr_t *slist)
 {
     register unsigned long i;
     size_t len, slen;
@@ -527,7 +527,7 @@
 spif_charptr_t 
 spiftool_get_pword(unsigned long index, const spif_charptr_t str)
 {
-    register const spif_charptr_t tmpstr = str;
+    register spif_charptr_t tmpstr = SPIF_CAST(charptr) str;
     register unsigned long j;
 
     ASSERT_RVAL(str != SPIF_NULL_TYPE(ptr), SPIF_NULL_TYPE(ptr));
@@ -590,7 +590,7 @@
 spif_charptr_t 
 spiftool_chomp(spif_charptr_t s)
 {
-    register spif_charptr_t front, *back;
+    register spif_charptr_t front, back;
 
     ASSERT_RVAL(s != NULL, NULL);
     for (front = s; *front && isspace(*front); front++);
@@ -650,7 +650,7 @@
 {
 
     register unsigned char gotspc = 0;
-    register spif_charptr_t pbuff = s, *pbuff2 = s;
+    register spif_charptr_t pbuff = s, pbuff2 = s;
 
     ASSERT_RVAL(s != SPIF_NULL_TYPE(ptr), SPIF_NULL_TYPE(ptr));
     D_STRINGS(("condense_whitespace(%s) called.\n", s));
@@ -693,7 +693,7 @@
 spiftool_hex_dump(void *buff, register size_t count)
 {
     register unsigned long j, k, l;
-    register unsigned spif_charptr_t ptr;
+    register spif_charptr_t ptr;
     unsigned char buffr[9];
 
     ASSERT(buff != SPIF_NULL_TYPE(ptr));
@@ -718,9 +718,9 @@
                                      || (isdigit(a) && isdigit(b)) \
                                      || (!isalnum(a) && !isalnum(b)))
 spif_cmp_t
-spiftool_version_compare(const spif_charptr_t v1, const spif_charptr_t v2)
+spiftool_version_compare(spif_charptr_t v1, spif_charptr_t v2)
 {
-    char buff1[128], buff2[128];
+    spif_char_t buff1[128], buff2[128];
 
     SPIF_COMP_CHECK_NULL(v1, v2);
 




-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to