summaryrefslogtreecommitdiff
path: root/src/examples
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-10-11 16:49:13 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-10-11 16:50:40 +0900
commit69e27abdc37f222183ce27f4ce0e3fe2a45ca590 (patch)
tree487cbabad5e0a5e5efd0c56063cf5d437484b4ea /src/examples
parent725237df0a8b8cab83c8f38368e5d0389dbd196e (diff)
eina - and e3fl in general - stop using eina_error_get/set - useless really
Diffstat (limited to 'src/examples')
-rw-r--r--src/examples/eina/eina_hash_01.c22
-rw-r--r--src/examples/eina/eina_hash_03.c22
-rw-r--r--src/examples/eina/eina_hash_04.c22
-rw-r--r--src/examples/eina/eina_hash_05.c22
-rw-r--r--src/examples/eina/eina_hash_06.c22
-rw-r--r--src/examples/eina/eina_hash_07.c22
-rw-r--r--src/examples/eina/eina_value_03.c4
7 files changed, 24 insertions, 112 deletions
diff --git a/src/examples/eina/eina_hash_01.c b/src/examples/eina/eina_hash_01.c
index 16418feeac..75181afb93 100644
--- a/src/examples/eina/eina_hash_01.c
+++ b/src/examples/eina/eina_hash_01.c
@@ -90,19 +90,12 @@ main(int argc, const char *argv[])
90 90
91 // Modify or add an entry to the hash with eina_hash_set 91 // Modify or add an entry to the hash with eina_hash_set
92 // Let's first add a new entry 92 // Let's first add a new entry
93 eina_error_set(0);
94 phone = eina_hash_set(phone_book, "Raul Seixas", 93 phone = eina_hash_set(phone_book, "Raul Seixas",
95 strdup("+55 01 234-56789")); 94 strdup("+55 01 234-56789"));
96 if (!phone) 95 if (!phone)
97 { 96 {
98 Eina_Error err = eina_error_get(); 97 printf("No previous phone found for Raul Seixas. ");
99 if (!err) 98 printf("Creating new entry.\n");
100 {
101 printf("No previous phone found for Raul Seixas. ");
102 printf("Creating new entry.\n");
103 }
104 else
105 printf("Error when setting phone for Raul Seixas\n");
106 } 99 }
107 else 100 else
108 { 101 {
@@ -113,7 +106,6 @@ main(int argc, const char *argv[])
113 printf("\n"); 106 printf("\n");
114 107
115 // Now change the phone number 108 // Now change the phone number
116 eina_error_set(0);
117 phone = eina_hash_set(phone_book, "Raul Seixas", 109 phone = eina_hash_set(phone_book, "Raul Seixas",
118 strdup("+55 02 222-22222")); 110 strdup("+55 02 222-22222"));
119 if (phone) 111 if (phone)
@@ -124,14 +116,8 @@ main(int argc, const char *argv[])
124 } 116 }
125 else 117 else
126 { 118 {
127 Eina_Error err = eina_error_get(); 119 printf("No previous phone found for Raul Seixas. ");
128 if (err) 120 printf("Creating new entry.\n");
129 printf("Error when changing phone for Raul Seixas\n");
130 else
131 {
132 printf("No previous phone found for Raul Seixas. ");
133 printf("Creating new entry.\n");
134 }
135 } 121 }
136 122
137 // There are many ways to iterate over our Phone book. 123 // There are many ways to iterate over our Phone book.
diff --git a/src/examples/eina/eina_hash_03.c b/src/examples/eina/eina_hash_03.c
index ba543d4179..b7323c4c5b 100644
--- a/src/examples/eina/eina_hash_03.c
+++ b/src/examples/eina/eina_hash_03.c
@@ -90,19 +90,12 @@ main(int argc, const char *argv[])
90 90
91 // Modify or add an entry to the hash with eina_hash_set 91 // Modify or add an entry to the hash with eina_hash_set
92 // Let's first add a new entry 92 // Let's first add a new entry
93 eina_error_set(0);
94 phone = eina_hash_set(phone_book, "Raul Seixas", 93 phone = eina_hash_set(phone_book, "Raul Seixas",
95 strdup("+55 01 234-56789")); 94 strdup("+55 01 234-56789"));
96 if (!phone) 95 if (!phone)
97 { 96 {
98 Eina_Error err = eina_error_get(); 97 printf("No previous phone found for Raul Seixas. ");
99 if (!err) 98 printf("Creating new entry.\n");
100 {
101 printf("No previous phone found for Raul Seixas. ");
102 printf("Creating new entry.\n");
103 }
104 else
105 printf("Error when setting phone for Raul Seixas\n");
106 } 99 }
107 else 100 else
108 { 101 {
@@ -113,7 +106,6 @@ main(int argc, const char *argv[])
113 printf("\n"); 106 printf("\n");
114 107
115 // Now change the phone number 108 // Now change the phone number
116 eina_error_set(0);
117 phone = eina_hash_set(phone_book, "Raul Seixas", 109 phone = eina_hash_set(phone_book, "Raul Seixas",
118 strdup("+55 02 222-22222")); 110 strdup("+55 02 222-22222"));
119 if (phone) 111 if (phone)
@@ -124,14 +116,8 @@ main(int argc, const char *argv[])
124 } 116 }
125 else 117 else
126 { 118 {
127 Eina_Error err = eina_error_get(); 119 printf("No previous phone found for Raul Seixas. ");
128 if (err) 120 printf("Creating new entry.\n");
129 printf("Error when changing phone for Raul Seixas\n");
130 else
131 {
132 printf("No previous phone found for Raul Seixas. ");
133 printf("Creating new entry.\n");
134 }
135 } 121 }
136 122
137 // There are many ways to iterate over our Phone book. 123 // There are many ways to iterate over our Phone book.
diff --git a/src/examples/eina/eina_hash_04.c b/src/examples/eina/eina_hash_04.c
index da73e04b1b..2441617d32 100644
--- a/src/examples/eina/eina_hash_04.c
+++ b/src/examples/eina/eina_hash_04.c
@@ -90,19 +90,12 @@ main(int argc, const char *argv[])
90 90
91 // Modify or add an entry to the hash with eina_hash_set 91 // Modify or add an entry to the hash with eina_hash_set
92 // Let's first add a new entry 92 // Let's first add a new entry
93 eina_error_set(0);
94 phone = eina_hash_set(phone_book, "Raul Seixas", 93 phone = eina_hash_set(phone_book, "Raul Seixas",
95 strdup("+55 01 234-56789")); 94 strdup("+55 01 234-56789"));
96 if (!phone) 95 if (!phone)
97 { 96 {
98 Eina_Error err = eina_error_get(); 97 printf("No previous phone found for Raul Seixas. ");
99 if (!err) 98 printf("Creating new entry.\n");
100 {
101 printf("No previous phone found for Raul Seixas. ");
102 printf("Creating new entry.\n");
103 }
104 else
105 printf("Error when setting phone for Raul Seixas\n");
106 } 99 }
107 else 100 else
108 { 101 {
@@ -113,7 +106,6 @@ main(int argc, const char *argv[])
113 printf("\n"); 106 printf("\n");
114 107
115 // Now change the phone number 108 // Now change the phone number
116 eina_error_set(0);
117 phone = eina_hash_set(phone_book, "Raul Seixas", 109 phone = eina_hash_set(phone_book, "Raul Seixas",
118 strdup("+55 02 222-22222")); 110 strdup("+55 02 222-22222"));
119 if (phone) 111 if (phone)
@@ -124,14 +116,8 @@ main(int argc, const char *argv[])
124 } 116 }
125 else 117 else
126 { 118 {
127 Eina_Error err = eina_error_get(); 119 printf("No previous phone found for Raul Seixas. ");
128 if (err) 120 printf("Creating new entry.\n");
129 printf("Error when changing phone for Raul Seixas\n");
130 else
131 {
132 printf("No previous phone found for Raul Seixas. ");
133 printf("Creating new entry.\n");
134 }
135 } 121 }
136 122
137 // There are many ways to iterate over our Phone book. 123 // There are many ways to iterate over our Phone book.
diff --git a/src/examples/eina/eina_hash_05.c b/src/examples/eina/eina_hash_05.c
index 6666ce2d3d..5e5c32d753 100644
--- a/src/examples/eina/eina_hash_05.c
+++ b/src/examples/eina/eina_hash_05.c
@@ -92,19 +92,12 @@ main(int argc, const char *argv[])
92 // Modify or add an entry to the hash with eina_hash_set 92 // Modify or add an entry to the hash with eina_hash_set
93 // Let's first add a new entry 93 // Let's first add a new entry
94 int32_t id5 = 5; 94 int32_t id5 = 5;
95 eina_error_set(0);
96 phone = eina_hash_set(phone_book, &id5, 95 phone = eina_hash_set(phone_book, &id5,
97 strdup("+55 01 234-56789")); 96 strdup("+55 01 234-56789"));
98 if (!phone) 97 if (!phone)
99 { 98 {
100 Eina_Error err = eina_error_get(); 99 printf("No previous phone found for id5. ");
101 if (!err) 100 printf("Creating new entry.\n");
102 {
103 printf("No previous phone found for id5. ");
104 printf("Creating new entry.\n");
105 }
106 else
107 printf("Error when setting phone for Raul Seixas\n");
108 } 101 }
109 else 102 else
110 { 103 {
@@ -115,7 +108,6 @@ main(int argc, const char *argv[])
115 printf("\n"); 108 printf("\n");
116 109
117 // Now change the phone number 110 // Now change the phone number
118 eina_error_set(0);
119 phone = eina_hash_set(phone_book, &id5, 111 phone = eina_hash_set(phone_book, &id5,
120 strdup("+55 02 222-22222")); 112 strdup("+55 02 222-22222"));
121 if (phone) 113 if (phone)
@@ -126,14 +118,8 @@ main(int argc, const char *argv[])
126 } 118 }
127 else 119 else
128 { 120 {
129 Eina_Error err = eina_error_get(); 121 printf("No previous phone found for id5. ");
130 if (err) 122 printf("Creating new entry.\n");
131 printf("Error when changing phone for id5\n");
132 else
133 {
134 printf("No previous phone found for id5. ");
135 printf("Creating new entry.\n");
136 }
137 } 123 }
138 124
139 // There are many ways to iterate over our Phone book. 125 // There are many ways to iterate over our Phone book.
diff --git a/src/examples/eina/eina_hash_06.c b/src/examples/eina/eina_hash_06.c
index a7a5504d2a..2df8a47190 100644
--- a/src/examples/eina/eina_hash_06.c
+++ b/src/examples/eina/eina_hash_06.c
@@ -92,19 +92,12 @@ main(int argc, const char *argv[])
92 // Modify or add an entry to the hash with eina_hash_set 92 // Modify or add an entry to the hash with eina_hash_set
93 // Let's first add a new entry 93 // Let's first add a new entry
94 int64_t id5 = 5; 94 int64_t id5 = 5;
95 eina_error_set(0);
96 phone = eina_hash_set(phone_book, &id5, 95 phone = eina_hash_set(phone_book, &id5,
97 strdup("+55 01 234-56789")); 96 strdup("+55 01 234-56789"));
98 if (!phone) 97 if (!phone)
99 { 98 {
100 Eina_Error err = eina_error_get(); 99 printf("No previous phone found for id5. ");
101 if (!err) 100 printf("Creating new entry.\n");
102 {
103 printf("No previous phone found for id5. ");
104 printf("Creating new entry.\n");
105 }
106 else
107 printf("Error when setting phone for Raul Seixas\n");
108 } 101 }
109 else 102 else
110 { 103 {
@@ -115,7 +108,6 @@ main(int argc, const char *argv[])
115 printf("\n"); 108 printf("\n");
116 109
117 // Now change the phone number 110 // Now change the phone number
118 eina_error_set(0);
119 phone = eina_hash_set(phone_book, &id5, 111 phone = eina_hash_set(phone_book, &id5,
120 strdup("+55 02 222-22222")); 112 strdup("+55 02 222-22222"));
121 if (phone) 113 if (phone)
@@ -126,14 +118,8 @@ main(int argc, const char *argv[])
126 } 118 }
127 else 119 else
128 { 120 {
129 Eina_Error err = eina_error_get(); 121 printf("No previous phone found for id5. ");
130 if (err) 122 printf("Creating new entry.\n");
131 printf("Error when changing phone for id5\n");
132 else
133 {
134 printf("No previous phone found for id5. ");
135 printf("Creating new entry.\n");
136 }
137 } 123 }
138 124
139 // There are many ways to iterate over our Phone book. 125 // There are many ways to iterate over our Phone book.
diff --git a/src/examples/eina/eina_hash_07.c b/src/examples/eina/eina_hash_07.c
index 1464e6b417..e6f0455dda 100644
--- a/src/examples/eina/eina_hash_07.c
+++ b/src/examples/eina/eina_hash_07.c
@@ -105,7 +105,6 @@ main(int argc, const char *argv[])
105 105
106 // Modify or add an entry to the hash with eina_hash_set 106 // Modify or add an entry to the hash with eina_hash_set
107 // Let's first add a new entry 107 // Let's first add a new entry
108 eina_error_set(0);
109 Phone_Entry *p1 = malloc(sizeof(*p1)); 108 Phone_Entry *p1 = malloc(sizeof(*p1));
110 p1->name = "Raul Seixas"; 109 p1->name = "Raul Seixas";
111 p1->number = "+55 01 234-56789"; 110 p1->number = "+55 01 234-56789";
@@ -113,14 +112,8 @@ main(int argc, const char *argv[])
113 strdup("raulzito")); 112 strdup("raulzito"));
114 if (!nick) 113 if (!nick)
115 { 114 {
116 Eina_Error err = eina_error_get(); 115 printf("No previous nick found for Raul Seixas. ");
117 if (!err) 116 printf("Creating new entry.\n");
118 {
119 printf("No previous nick found for Raul Seixas. ");
120 printf("Creating new entry.\n");
121 }
122 else
123 printf("Error when setting nick for Raul Seixas\n");
124 } 117 }
125 else 118 else
126 { 119 {
@@ -131,7 +124,6 @@ main(int argc, const char *argv[])
131 printf("\n"); 124 printf("\n");
132 125
133 // Now change the nick 126 // Now change the nick
134 eina_error_set(0);
135 nick = eina_hash_set(phone_book, &p1, 127 nick = eina_hash_set(phone_book, &p1,
136 strdup("raulzao")); 128 strdup("raulzao"));
137 if (nick) 129 if (nick)
@@ -142,14 +134,8 @@ main(int argc, const char *argv[])
142 } 134 }
143 else 135 else
144 { 136 {
145 Eina_Error err = eina_error_get(); 137 printf("No previous nick found for Raul Seixas. ");
146 if (err) 138 printf("Creating new entry.\n");
147 printf("Error when changing nick for Raul Seixas\n");
148 else
149 {
150 printf("No previous nick found for Raul Seixas. ");
151 printf("Creating new entry.\n");
152 }
153 } 139 }
154 140
155 // There are many ways to iterate over our Phone book. 141 // There are many ways to iterate over our Phone book.
diff --git a/src/examples/eina/eina_value_03.c b/src/examples/eina/eina_value_03.c
index 85f42b3c49..30520d116c 100644
--- a/src/examples/eina/eina_value_03.c
+++ b/src/examples/eina/eina_value_03.c
@@ -65,8 +65,6 @@ _tz_convert_to(const Eina_Value_Type *type, const Eina_Value_Type *convert, cons
65{ 65{
66 struct timezone v = *(struct timezone*)type_mem; 66 struct timezone v = *(struct timezone*)type_mem;
67 67
68 eina_error_set(0);
69
70 if (convert == EINA_VALUE_TYPE_UCHAR) 68 if (convert == EINA_VALUE_TYPE_UCHAR)
71 { 69 {
72 unsigned char other_mem = v.tz_minuteswest; 70 unsigned char other_mem = v.tz_minuteswest;
@@ -130,8 +128,6 @@ _tz_convert_to(const Eina_Value_Type *type, const Eina_Value_Type *convert, cons
130 other_mem = buf; /* required due &buf == buf */ 128 other_mem = buf; /* required due &buf == buf */
131 return eina_value_type_pset(convert, convert_mem, &other_mem); 129 return eina_value_type_pset(convert, convert_mem, &other_mem);
132 } 130 }
133
134 eina_error_set(EINA_ERROR_VALUE_FAILED);
135 return EINA_FALSE; 131 return EINA_FALSE;
136} 132}
137 133