summaryrefslogtreecommitdiff
path: root/src/lib/ecore_con
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-05-19 11:41:27 +0100
committerTom Hacohen <tom@stosb.com>2015-05-20 13:03:24 +0100
commit6efbfe227aaaa24eda7bcb7df916d4daf0a74400 (patch)
treec96e166b7348c5e825aca2d4af084675172e0cec /src/lib/ecore_con
parente7ed0bfcedcea87f8645107a8a0775f67227d7c1 (diff)
Eo: Add a return value to eo_constructor().
From now on, constructors should return a value, usually the object being worked on, or NULL (if the constructor failed). This can also be used for implementing singletons, by just always returning the same object from the constructor. This is one of the final steps towards stabilizing Eo. @feature
Diffstat (limited to 'src/lib/ecore_con')
-rw-r--r--src/lib/ecore_con/ecore_con.c6
-rw-r--r--src/lib/ecore_con/ecore_con_url.c9
2 files changed, 9 insertions, 6 deletions
diff --git a/src/lib/ecore_con/ecore_con.c b/src/lib/ecore_con/ecore_con.c
index dee26e1729..bc121d3965 100644
--- a/src/lib/ecore_con/ecore_con.c
+++ b/src/lib/ecore_con/ecore_con.c
@@ -372,15 +372,17 @@ ecore_con_server_add(Ecore_Con_Type compl_type,
372 return obj; 372 return obj;
373} 373}
374 374
375EOLIAN static void 375EOLIAN static Eo *
376_ecore_con_server_eo_base_constructor(Ecore_Con_Server *obj, Ecore_Con_Server_Data *svr) 376_ecore_con_server_eo_base_constructor(Ecore_Con_Server *obj, Ecore_Con_Server_Data *svr)
377{ 377{
378 eo_do_super(obj, ECORE_CON_SERVER_CLASS, eo_constructor()); 378 obj = eo_do_super_ret(obj, ECORE_CON_SERVER_CLASS, obj, eo_constructor());
379 379
380 svr->fd = -1; 380 svr->fd = -1;
381 svr->reject_excess_clients = EINA_FALSE; 381 svr->reject_excess_clients = EINA_FALSE;
382 svr->client_limit = -1; 382 svr->client_limit = -1;
383 svr->clients = NULL; 383 svr->clients = NULL;
384
385 return obj;
384} 386}
385 387
386EOLIAN static Eo * 388EOLIAN static Eo *
diff --git a/src/lib/ecore_con/ecore_con_url.c b/src/lib/ecore_con/ecore_con_url.c
index 37902edacd..37f5fa0b6c 100644
--- a/src/lib/ecore_con/ecore_con_url.c
+++ b/src/lib/ecore_con/ecore_con_url.c
@@ -453,25 +453,26 @@ ecore_con_url_new(const char *url)
453 return url_obj; 453 return url_obj;
454} 454}
455 455
456EOLIAN static void 456EOLIAN static Eo *
457_efl_network_url_eo_base_constructor(Efl_Network_Url *url_obj, Efl_Network_Url_Data *url_con EINA_UNUSED) 457_efl_network_url_eo_base_constructor(Efl_Network_Url *url_obj, Efl_Network_Url_Data *url_con EINA_UNUSED)
458{ 458{
459 eo_do_super(url_obj, MY_CLASS, eo_constructor()); 459 url_obj = eo_do_super_ret(url_obj, MY_CLASS, url_obj, eo_constructor());
460 460
461 if (!_init_count) eo_error_set(url_obj); 461 if (!_init_count) eo_error_set(url_obj);
462 if (!_c_init()) 462 if (!_c_init())
463 { 463 {
464 eo_error_set(url_obj); 464 eo_error_set(url_obj);
465 return; 465 return NULL;
466 } 466 }
467 467
468 url_con->curl_easy = _c->curl_easy_init(); 468 url_con->curl_easy = _c->curl_easy_init();
469 if (!url_con->curl_easy) 469 if (!url_con->curl_easy)
470 { 470 {
471 eo_error_set(url_obj); 471 eo_error_set(url_obj);
472 return; 472 return NULL;
473 } 473 }
474 474
475 return url_obj;
475} 476}
476 477
477EOLIAN static Eo * 478EOLIAN static Eo *