Enlightenment CVS committal
Author : dj2
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src/lib
Modified Files:
ewl_checkbutton.c ewl_checkbutton.h
Log Message:
- formatting and type checking
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_checkbutton.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ewl_checkbutton.c 3 Oct 2005 06:43:06 -0000 1.4
+++ ewl_checkbutton.c 23 Oct 2005 16:52:36 -0000 1.5
@@ -7,7 +7,8 @@
* @return Returns the newly allocated checkbutton on success, NULL on failure.
* @brief Allocate and initialize a new check button
*/
-Ewl_Widget *ewl_checkbutton_new()
+Ewl_Widget *
+ewl_checkbutton_new(void)
{
Ewl_CheckButton *b;
@@ -15,9 +16,12 @@
b = NEW(Ewl_CheckButton, 1);
if (!b)
- return NULL;
+ DRETURN_PTR(NULL, DLEVEL_STABLE);
- ewl_checkbutton_init(b);
+ if (!ewl_checkbutton_init(b)) {
+ ewl_widget_destroy(EWL_WIDGET(b));
+ b = NULL;
+ }
DRETURN_PTR(EWL_WIDGET(b), DLEVEL_STABLE);
}
@@ -30,12 +34,14 @@
* The internal structures and callbacks of the checkbutton are initialized to
* default values.
*/
-int ewl_checkbutton_init(Ewl_CheckButton * cb)
+int
+ewl_checkbutton_init(Ewl_CheckButton *cb)
{
- Ewl_Button *b;
- Ewl_Widget *w;
+ Ewl_Button *b;
+ Ewl_Widget *w;
DENTER_FUNCTION(DLEVEL_STABLE);
+ DCHECK_PARAM_PTR_RET("cb", cb, FALSE);
b = EWL_BUTTON(cb);
w = EWL_WIDGET(cb);
@@ -72,12 +78,14 @@
*
* Changes the position of the label associated with the check button.
*/
-void ewl_checkbutton_label_position_set(Ewl_CheckButton * cb, Ewl_Position p)
+void
+ewl_checkbutton_label_position_set(Ewl_CheckButton *cb, Ewl_Position p)
{
- Ewl_Button *b;
+ Ewl_Button *b;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("cb", cb);
+ DCHECK_TYPE("cb", cb, "checkbutton");
b = EWL_BUTTON(cb);
@@ -108,13 +116,15 @@
DLEAVE_FUNCTION(DLEVEL_STABLE);
}
-void ewl_checkbutton_clicked_cb(Ewl_Widget * w, void *ev_data __UNUSED__,
+void
+ewl_checkbutton_clicked_cb(Ewl_Widget *w, void *ev_data __UNUSED__,
void *user_data __UNUSED__)
{
Ewl_CheckButton *cb;
DENTER_FUNCTION(DLEVEL_STABLE);
DCHECK_PARAM_PTR("w", w);
+ DCHECK_TYPE("w", w, "widget");
cb = EWL_CHECKBUTTON(w);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/lib/ewl_checkbutton.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -3 -r1.4 -r1.5
--- ewl_checkbutton.h 3 Oct 2005 06:43:06 -0000 1.4
+++ ewl_checkbutton.h 23 Oct 2005 16:52:36 -0000 1.5
@@ -1,4 +1,3 @@
-
#ifndef __EWL_CHECKBUTTON_H__
#define __EWL_CHECKBUTTON_H__
@@ -43,7 +42,7 @@
};
Ewl_Widget *ewl_checkbutton_new(void);
-int ewl_checkbutton_init(Ewl_CheckButton * cb);
+int ewl_checkbutton_init(Ewl_CheckButton *cb);
/**
* @def ewl_checkbutton_checked_set(cb, c);
@@ -61,13 +60,13 @@
#define ewl_checkbutton_is_checked(cb) \
ewl_check_is_checked(EWL_CHECK(EWL_CHECKBUTTON(cb)->check))
-void ewl_checkbutton_label_position_set(Ewl_CheckButton * cb,
+void ewl_checkbutton_label_position_set(Ewl_CheckButton *cb,
Ewl_Position p);
/*
* Internally used callbacks, override at your own risk
*/
-void ewl_checkbutton_clicked_cb(Ewl_Widget * w, void *ev_data,
+void ewl_checkbutton_clicked_cb(Ewl_Widget *w, void *ev_data,
void *user_data);
/**
-------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs