Revision: 5035 http://geany.svn.sourceforge.net/geany/?rev=5035&view=rev Author: statc Date: 2010-06-17 14:52:47 +0000 (Thu, 17 Jun 2010)
Log Message: ----------- Minor code style improvements
Modified Paths: -------------- branches/sm/src/sm.c
Modified: branches/sm/src/sm.c =================================================================== --- branches/sm/src/sm.c 2010-06-17 14:52:29 UTC (rev 5034) +++ branches/sm/src/sm.c 2010-06-17 14:52:47 UTC (rev 5035) @@ -55,6 +55,7 @@ #include <X11/SM/SMlib.h> #include <X11/ICE/ICElib.h>
+#include "sm.h" #include "geany.h" #include "main.h" /* for cl_options */ #include "ui_utils.h" /* access main_widgets.notebook to iterate over opened docs */ @@ -72,8 +73,8 @@ static void sm_set_constant_props(SmcConn smcon); static void sm_store_props(const char * argv0, const char * libsm_client_id); static void sm_set_runtime_props(SmcConn smcon); -static void sm_cmd_props(); -static void sm_files_props(); +static void sm_cmd_props(GArray * arr); +static void sm_files_props(GArray * arr);
static void sm_save_yourself_callback(SmcConn smcon, SmPointer client_data, int save_type, Bool shutdown, int interact_style, Bool fast); @@ -134,11 +135,8 @@ char * new_client_id;
/* This function should be called once */ - g_assert(!smc_conn); - if (smc_conn) - return; + g_return_if_fail(!smc_conn);
- smc_conn = sm_connect(libsm_client_id, &new_client_id); if (!smc_conn) return; @@ -166,7 +164,7 @@ if (smc_conn) { SmcCloseConnection(smc_conn, 0, NULL); - smc_conn = 0; + smc_conn = NULL; } #endif } @@ -258,7 +256,7 @@ * it is no longer needed. If connection to the * session manager fails, the variable is filled * with @c NULL pointer. - * @return libSM connection object or @c 0 if connection to the session manager fails. + * @return libSM connection object or @c NULL if connection to the session manager fails. */ static SmcConn sm_connect(const char * libsm_client_id, char ** new_client_id) { @@ -272,7 +270,7 @@ SmcConn smcon;
if (!g_getenv("SESSION_MANAGER")) - return 0; + return NULL;
IceAddConnectionWatch(ice_connection_watch, NULL);
@@ -289,9 +287,8 @@ if (!smcon) { g_warning("While connecting to session manager:\n%s.", err); - IceRemoveConnectionWatch(ice_connection_watch, NULL); - return 0; + return NULL; }
return smcon;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.