summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Williams <andy@andywilliams.me>2017-12-22 11:18:46 +0000
committerAndy Williams <andy@andywilliams.me>2017-12-22 11:18:46 +0000
commit9a4eedb078bde1ea15d80ba2f285f7d2dc672c10 (patch)
treee046528c0aedc098d2c66f3713af644c145c6651
parent77dd065c52202c9f517d3b846e80c3db7e5526a0 (diff)
Remove all ocurrences of SPANK from our user facing errors.
This has been bugging me for some time but now we are triggering new errors internally this is appearing to end users for problems they did not cause. Additionally I was able to improve a couple of the errors by copying the explanation from code comments into the error message. Shorter error logs now too :)
-rw-r--r--src/lib/ecore/ecore.c4
-rw-r--r--src/lib/ecore/ecore_exe_posix.c9
-rw-r--r--src/lib/edje/edje_load.c2
-rw-r--r--src/lib/edje/edje_program.c2
-rw-r--r--src/lib/eina/eina_magic.c20
-rw-r--r--src/tests/eina/eina_test_magic.c15
6 files changed, 12 insertions, 40 deletions
diff --git a/src/lib/ecore/ecore.c b/src/lib/ecore/ecore.c
index 26a7481d49..85040f532d 100644
--- a/src/lib/ecore/ecore.c
+++ b/src/lib/ecore/ecore.c
@@ -801,9 +801,7 @@ _ecore_magic_fail(const void *d,
801 " Supplied: %08x - %s", 801 " Supplied: %08x - %s",
802 (unsigned int)req_m, _ecore_magic_string_get(req_m), 802 (unsigned int)req_m, _ecore_magic_string_get(req_m),
803 (unsigned int)m, _ecore_magic_string_get(m)); 803 (unsigned int)m, _ecore_magic_string_get(m));
804 ERR("*** NAUGHTY PROGRAMMER!!!\n" 804
805 "*** SPANK SPANK SPANK!!!\n"
806 "*** Now go fix your code. Tut tut tut!");
807 if (getenv("ECORE_ERROR_ABORT")) abort(); 805 if (getenv("ECORE_ERROR_ABORT")) abort();
808} 806}
809 807
diff --git a/src/lib/ecore/ecore_exe_posix.c b/src/lib/ecore/ecore_exe_posix.c
index 2d8fa98983..a9332d1832 100644
--- a/src/lib/ecore/ecore_exe_posix.c
+++ b/src/lib/ecore/ecore_exe_posix.c
@@ -180,9 +180,7 @@ _ecore_exe_check_errno(int result,
180 case EPERM: 180 case EPERM:
181 case EBUSY: 181 case EBUSY:
182 { /* Programmer fucked up. */ 182 { /* Programmer fucked up. */
183 ERR("*** NAUGHTY PROGRAMMER!!!\n" 183 ERR("*** Race condition between open() and dup() created in %s @%u.",
184 "*** SPANK SPANK SPANK!!!\n"
185 "*** Now go fix your code in %s @%u. Tut tut tut!",
186 file, line); 184 file, line);
187 result = 0; 185 result = 0;
188 break; 186 break;
@@ -190,10 +188,7 @@ _ecore_exe_check_errno(int result,
190 188
191 default: 189 default:
192 { /* Unsupported errno code, please add this one. */ 190 { /* Unsupported errno code, please add this one. */
193 ERR("*** NAUGHTY PROGRAMMER!!!\n" 191 ERR("*** Unsupported errno code %d, found in %s @%u, from %s @%u.",
194 "*** SPANK SPANK SPANK!!!\n"
195 "*** Unsupported errno code %d, please add this one.\n"
196 "*** Now go fix your code in %s @%u, from %s @%u. Tut tut tut!",
197 saved_errno, __FILE__, __LINE__, file, line); 192 saved_errno, __FILE__, __LINE__, file, line);
198 result = 0; 193 result = 0;
199 break; 194 break;
diff --git a/src/lib/edje/edje_load.c b/src/lib/edje/edje_load.c
index 080cca567d..34492c847b 100644
--- a/src/lib/edje/edje_load.c
+++ b/src/lib/edje/edje_load.c
@@ -1072,7 +1072,7 @@ _edje_object_file_set_internal(Evas_Object *obj, const Eina_File *file, const ch
1072 break; 1072 break;
1073 1073
1074 case EDJE_PART_TYPE_GRADIENT: 1074 case EDJE_PART_TYPE_GRADIENT:
1075 ERR("SPANK ! SPANK ! SPANK ! YOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !! THEY ARE NOW REMOVED !", 1075 ERR("YOU ARE USING GRADIENT IN PART %s FROM GROUP %s INSIDE FILE %s !! THEY ARE NOW REMOVED !",
1076 ep->name, group, eina_file_filename_get(file)); 1076 ep->name, group, eina_file_filename_get(file));
1077 break; 1077 break;
1078 1078
diff --git a/src/lib/edje/edje_program.c b/src/lib/edje/edje_program.c
index dd6e73c260..1746c7f560 100644
--- a/src/lib/edje/edje_program.c
+++ b/src/lib/edje/edje_program.c
@@ -122,7 +122,7 @@ _edje_emit_child(Edje *ed, Edje_Real_Part *rp, const char *part, const char *sig
122 break; 122 break;
123 123
124 default: 124 default:
125 // ERR("SPANK SPANK SPANK !!!\nYou should never be here !"); 125 // ERR("Unknown part type. You should never be here!");
126 break; 126 break;
127 } 127 }
128 return ed->collection->broadcast_signal; 128 return ed->collection->broadcast_signal;
diff --git a/src/lib/eina/eina_magic.c b/src/lib/eina/eina_magic.c
index 082e7f4259..c1918419fc 100644
--- a/src/lib/eina/eina_magic.c
+++ b/src/lib/eina/eina_magic.c
@@ -273,32 +273,23 @@ eina_magic_fail(void *d,
273 eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_ERR, 273 eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_ERR,
274 file, fnc, line, 274 file, fnc, line,
275 "*** Eina Magic Check Failed !!!\n" 275 "*** Eina Magic Check Failed !!!\n"
276 " Input handle pointer is NULL !\n" 276 " Input handle pointer is NULL.\n"
277 "*** NAUGHTY PROGRAMMER!!!\n"
278 "*** SPANK SPANK SPANK!!!\n"
279 "*** Now go fix your code. Tut tut tut!\n"
280 "\n"); 277 "\n");
281 else 278 else
282 if (m == EINA_MAGIC_NONE) 279 if (m == EINA_MAGIC_NONE)
283 eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL, 280 eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL,
284 file, fnc, line, 281 file, fnc, line,
285 "*** Eina Magic Check Failed at %p !!!\n" 282 "*** Eina Magic Check Failed at %p !!!\n"
286 " Input handle has already been freed!\n" 283 " Input handle has already been freed.\n"
287 "*** NAUGHTY PROGRAMMER!!!\n"
288 "*** SPANK SPANK SPANK!!!\n"
289 "*** Now go fix your code. Tut tut tut!\n"
290 "\n", d); 284 "\n", d);
291 else 285 else
292 if (m != req_m) 286 if (m != req_m)
293 eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL, 287 eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL,
294 file, fnc, line, 288 file, fnc, line,
295 "*** Eina Magic Check Failed at %p !!!\n" 289 "*** Eina Magic Check Failed at %p !!!\n"
296 " Input handle is wrong type\n" 290 " Input handle is wrong type.\n"
297 " Expected: %08x - %s\n" 291 " Expected: %08x - %s\n"
298 " Supplied: %08x - %s\n" 292 " Supplied: %08x - %s\n"
299 "*** NAUGHTY PROGRAMMER!!!\n"
300 "*** SPANK SPANK SPANK!!!\n"
301 "*** Now go fix your code. Tut tut tut!\n"
302 "\n", 293 "\n",
303 d, req_m, eina_magic_string_get(req_m), 294 d, req_m, eina_magic_string_get(req_m),
304 m, eina_magic_string_get(m)); 295 m, eina_magic_string_get(m));
@@ -306,10 +297,7 @@ eina_magic_fail(void *d,
306 eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL, 297 eina_log_print(EINA_LOG_DOMAIN_GLOBAL, EINA_LOG_LEVEL_CRITICAL,
307 file, fnc, line, 298 file, fnc, line,
308 "*** Eina Magic Check Failed !!!\n" 299 "*** Eina Magic Check Failed !!!\n"
309 " Why did you call me !\n" 300 " Unknown reason.\n"
310 "*** NAUGHTY PROGRAMMER!!!\n"
311 "*** SPANK SPANK SPANK!!!\n"
312 "*** Now go fix your code. Tut tut tut!\n"
313 "\n"); 301 "\n");
314} 302}
315 303
diff --git a/src/tests/eina/eina_test_magic.c b/src/tests/eina/eina_test_magic.c
index b6f8fdc369..14a6f0dd7b 100644
--- a/src/tests/eina/eina_test_magic.c
+++ b/src/tests/eina/eina_test_magic.c
@@ -148,10 +148,7 @@ START_TEST(eina_magic_simple)
148#endif 148#endif
149 TEST_MAGIC_SAFETY(__FUNCTION__, 149 TEST_MAGIC_SAFETY(__FUNCTION__,
150 "*** Eina Magic Check Failed !!!\n" 150 "*** Eina Magic Check Failed !!!\n"
151 " Input handle pointer is NULL !\n" 151 " Input handle pointer is NULL.\n"
152 "*** NAUGHTY PROGRAMMER!!!\n"
153 "*** SPANK SPANK SPANK!!!\n"
154 "*** Now go fix your code. Tut tut tut!\n"
155 "\n"); 152 "\n");
156 EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST); 153 EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST);
157 fail_unless(ctx.did); 154 fail_unless(ctx.did);
@@ -169,10 +166,7 @@ START_TEST(eina_magic_simple)
169#endif 166#endif
170 TEST_MAGIC_SAFETY(__FUNCTION__, 167 TEST_MAGIC_SAFETY(__FUNCTION__,
171 "*** Eina Magic Check Failed at %p !!!\n" 168 "*** Eina Magic Check Failed at %p !!!\n"
172 " Input handle has already been freed!\n" 169 " Input handle has already been freed.\n"
173 "*** NAUGHTY PROGRAMMER!!!\n"
174 "*** SPANK SPANK SPANK!!!\n"
175 "*** Now go fix your code. Tut tut tut!\n"
176 "\n"); 170 "\n");
177 ctx.expected_level = EINA_LOG_LEVEL_CRITICAL; 171 ctx.expected_level = EINA_LOG_LEVEL_CRITICAL;
178 EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST); 172 EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST);
@@ -184,12 +178,9 @@ START_TEST(eina_magic_simple)
184#endif 178#endif
185 TEST_MAGIC_SAFETY(__FUNCTION__, 179 TEST_MAGIC_SAFETY(__FUNCTION__,
186 "*** Eina Magic Check Failed at %p !!!\n" 180 "*** Eina Magic Check Failed at %p !!!\n"
187 " Input handle is wrong type\n" 181 " Input handle is wrong type.\n"
188 " Expected: %08x - %s\n" 182 " Expected: %08x - %s\n"
189 " Supplied: %08x - %s\n" 183 " Supplied: %08x - %s\n"
190 "*** NAUGHTY PROGRAMMER!!!\n"
191 "*** SPANK SPANK SPANK!!!\n"
192 "*** Now go fix your code. Tut tut tut!\n"
193 "\n"); 184 "\n");
194 ctx.expected_level = EINA_LOG_LEVEL_CRITICAL; 185 ctx.expected_level = EINA_LOG_LEVEL_CRITICAL;
195 EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST); 186 EINA_MAGIC_FAIL(ems, EINA_MAGIC_TEST);