Hi list

Here are three patches for Eina:

 01  Removes some unused variables.
 02  Fixes bad format strings in *printf() calls.
 03  Fixes typo and removes redundant duplicate code.


-- Igor
Index: src/examples/eina_array_01.c
===================================================================
--- src/examples/eina_array_01.c	(revision 77368)
+++ src/examples/eina_array_01.c	(working copy)
@@ -23,8 +23,6 @@
       "skulls", "bulldog", "flat top", "hammerhead", "gonzo"
    };
    Eina_Array *array;
-   Eina_Array_Iterator iterator;
-   char *item;
    unsigned int i;
 
    eina_init();
Index: src/examples/eina_hash_08.c
===================================================================
--- src/examples/eina_hash_08.c	(revision 77368)
+++ src/examples/eina_hash_08.c	(working copy)
@@ -59,8 +59,6 @@
    int saved_entry_size = sizeof("Alceu Valenca");
    const char *phone = NULL;
    Eina_Bool r;
-   Eina_Iterator *it;
-   void *data;
 
    eina_init();
 
Index: src/examples/eina_array_02.c
===================================================================
--- src/examples/eina_array_02.c	(revision 77368)
+++ src/examples/eina_array_02.c	(working copy)
@@ -47,7 +47,7 @@
 
    eina_array_remove(array, keep, NULL);
    EINA_ARRAY_ITER_NEXT(array, i, item, iterator)
-     printf("item #%d: %s\n", i, item);
+     printf("item #%u: %s\n", i, item);
 
    eina_array_free(array);
 
Index: src/lib/eina_share_common.c
===================================================================
--- src/lib/eina_share_common.c	(revision 77368)
+++ src/lib/eina_share_common.c	(working copy)
@@ -241,7 +241,7 @@
         sizeof (share->population_group[0]);
         ++i)
       fprintf(stderr,
-              "DDD: %i strings of length %i, max strings: %i\n",
+              "DDD: %i strings of length %u, max strings: %i\n",
               share->population_group[i].count,
               i,
               share->population_group[i].max);
@@ -935,7 +935,7 @@
         sizeof (share->population_group[0]);
         ++i)
       fprintf(stderr,
-              "DDD: %i strings of length %i, max strings: %i\n",
+              "DDD: %i strings of length %u, max strings: %i\n",
               share->population_group[i].count,
               i,
               share->population_group[i].max);
Index: src/tests/ecore_hash.c
===================================================================
--- src/tests/ecore_hash.c	(revision 77368)
+++ src/tests/ecore_hash.c	(working copy)
@@ -396,14 +396,14 @@
    for (i = 0; i < ecore_prime_table[hash->size]; i++)
       if (hash->buckets[i])
         {
-           int n = 0;
+           unsigned int n = 0;
            Ecore_Hash_Node *node;
            for (node = hash->buckets[i]; node; node = node->next)
               n++;
-           printf("%d\t%u", i, n);
+           printf("%u\t%u", i, n);
         }
       else
-           printf("%d\t0",  i);
+           printf("%u\t0",  i);
 
 }
 
Index: src/tests/eina_test_error.c
===================================================================
--- src/tests/eina_test_error.c	(revision 77368)
+++ src/tests/eina_test_error.c	(working copy)
@@ -158,7 +158,7 @@
 
    for (i = 0; i < sizeof(codes)/sizeof(codes[0]); i++)
      {
-        snprintf(buf, sizeof(buf), "myerr-%d", i);
+        snprintf(buf, sizeof(buf), "myerr-%u", i);
         codes[i] = eina_error_msg_register(buf);
         ck_assert_int_ne(codes[i], 0);
      }
@@ -167,7 +167,7 @@
      {
         int found;
 
-        snprintf(buf, sizeof(buf), "myerr-%d", i);
+        snprintf(buf, sizeof(buf), "myerr-%u", i);
 
         found = eina_error_find(buf);
         ck_assert_int_eq(codes[i], found);
Index: src/lib/eina_file_win32.c
===================================================================
--- src/lib/eina_file_win32.c	(revision 77368)
+++ src/lib/eina_file_win32.c	(working copy)
@@ -407,7 +407,6 @@
      it->info.type = EINA_FILE_LNK;
    else if (attr & (FILE_ATTRIBUTE_ARCHIVE |
                     FILE_ATTRIBUTE_COMPRESSED |
-                    FILE_ATTRIBUTE_COMPRESSED |
                     FILE_ATTRIBUTE_HIDDEN |
                     FILE_ATTRIBUTE_NORMAL |
                     FILE_ATTRIBUTE_SPARSE_FILE |
Index: src/lib/eina_log.c
===================================================================
--- src/lib/eina_log.c	(revision 77368)
+++ src/lib/eina_log.c	(working copy)
@@ -320,7 +320,7 @@
                     attr |= BACKGROUND_RED;
                   else if (code == 42)
                     attr |= BACKGROUND_GREEN;
-                  else if (code == 44)
+                  else if (code == 43)
                     attr |= BACKGROUND_RED | BACKGROUND_GREEN;
                   else if (code == 44)
                     attr |= BACKGROUND_BLUE;
Index: src/lib/eina_str.c
===================================================================
--- src/lib/eina_str.c	(revision 77368)
+++ src/lib/eina_str.c	(working copy)
@@ -490,22 +490,6 @@
                   outalloc += 64;
                   outb += 64;
                }
-             else if (errno == EILSEQ)
-               {
-                  if (new_txt)
-                     free(new_txt);
-
-                  new_txt = NULL;
-                  break;
-               }
-             else if (errno == EINVAL)
-               {
-                  if (new_txt)
-                     free(new_txt);
-
-                  new_txt = NULL;
-                  break;
-               }
              else
                {
                   if (new_txt)
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to