Enlightenment CVS committal

Author  : dj2
Project : e17
Module  : libs/ewl

Dir     : e17/libs/ewl/src/lib


Modified Files:
        ewl_spacer.c ewl_spacer.h 


Log Message:
- formating/ type checking

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_spacer.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ewl_spacer.c        3 Oct 2005 06:43:07 -0000       1.4
+++ ewl_spacer.c        25 Oct 2005 04:52:22 -0000      1.5
@@ -7,9 +7,10 @@
  * @return Returns NULL on failure, a pointer to a new spacer on success
  * @brief Allocate and initialize a new spacer
  */
-Ewl_Widget     *ewl_spacer_new()
+Ewl_Widget *
+ewl_spacer_new(void)
 {
-       Ewl_Spacer     *s;
+       Ewl_Spacer *s;
 
        DENTER_FUNCTION(DLEVEL_STABLE);
 
@@ -17,25 +18,31 @@
        if (!s)
                DRETURN_PTR(NULL, DLEVEL_STABLE);
 
-       ewl_spacer_init(s);
+       if (!ewl_spacer_init(s)) {
+               ewl_widget_destroy(EWL_WIDGET(s));
+               s = NULL;
+       }
 
        DRETURN_PTR(EWL_WIDGET(s), DLEVEL_STABLE);
 }
 
 /**
  * @param s: the spacer to initialize
- * @return Returns no value.
+ * @return Returns TRUE on success or FALSE on failure
  * @brief Initialize a spacer to starting values
  *
  * Initializes a spacer to default values and callbacks.
  */
-void ewl_spacer_init(Ewl_Spacer * s)
+int
+ewl_spacer_init(Ewl_Spacer *s)
 {
        DENTER_FUNCTION(DLEVEL_STABLE);
+       DCHECK_PARAM_PTR_RET("s", s, FALSE);
 
        ewl_widget_init(EWL_WIDGET(s));
        ewl_widget_appearance_set(EWL_WIDGET(s), "spacer");
        ewl_widget_inherit(EWL_WIDGET(s), "spacer");
 
-       DLEAVE_FUNCTION(DLEVEL_STABLE);
+       DRETURN_INT(TRUE, DLEVEL_STABLE);
 }
+
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_spacer.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -3 -r1.2 -r1.3
--- ewl_spacer.h        9 Feb 2005 20:44:12 -0000       1.2
+++ ewl_spacer.h        25 Oct 2005 04:52:22 -0000      1.3
@@ -1,4 +1,3 @@
-
 #ifndef __EWL_SPACER_H__
 #define __EWL_SPACER_H__
 
@@ -38,8 +37,8 @@
  */
 #define EWL_SPACER(spacer) ((Ewl_Spacer *) spacer)
 
-Ewl_Widget     *ewl_spacer_new(void);
-void            ewl_spacer_init(Ewl_Spacer * s);
+Ewl_Widget     *ewl_spacer_new(void);
+int             ewl_spacer_init(Ewl_Spacer *s);
 
 /**
  * @}




-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to