/pidgin/main: d160ede64878: MXit: Whitespace changes for coding-...

Andrew Victor andrew.victor at mxit.com
Mon Apr 1 06:33:50 EDT 2013


Changeset: d160ede64878029a73d55e3f7b2ef1e53f6576e5
Author:	 Andrew Victor <andrew.victor at mxit.com>
Date:	 2013-04-01 10:42 +0200
Branch:	 release-2.x.y
URL: https://hg.pidgin.im/pidgin/main/rev/d160ede64878

Description:

MXit: Whitespace changes for coding-style consistency.
(ie, makes the code more closely match what is in the 3.0.0 tree)

diffstat:

 libpurple/protocols/mxit/actions.c    |  12 +++++-----
 libpurple/protocols/mxit/formcmds.c   |   4 +-
 libpurple/protocols/mxit/markup.c     |   4 +-
 libpurple/protocols/mxit/multimx.c    |   2 +-
 libpurple/protocols/mxit/mxit.c       |  20 ++++++++--------
 libpurple/protocols/mxit/mxit.h       |   2 +-
 libpurple/protocols/mxit/profile.c    |  12 +++++-----
 libpurple/protocols/mxit/protocol.c   |  22 +++++++++---------
 libpurple/protocols/mxit/roster.c     |  40 +++++++++++++++++-----------------
 libpurple/protocols/mxit/roster.h     |   2 +-
 libpurple/protocols/mxit/voicevideo.c |   2 +-
 11 files changed, 61 insertions(+), 61 deletions(-)

diffs (truncated from 422 to 300 lines):

diff --git a/libpurple/protocols/mxit/actions.c b/libpurple/protocols/mxit/actions.c
--- a/libpurple/protocols/mxit/actions.c
+++ b/libpurple/protocols/mxit/actions.c
@@ -159,7 +159,7 @@ out:
 
 		/* update where am i */
 		name = purple_request_fields_get_string( fields, "whereami" );
-		if ( !name)
+		if ( !name )
 			profile->whereami[0] = '\0';
 		else
 			g_strlcpy( profile->whereami, name, sizeof( profile->whereami ) );
@@ -393,8 +393,8 @@ static void mxit_change_pin_action( Purp
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_change_pin_action\n" );
 
 	fields = purple_request_fields_new();
-	group = purple_request_field_group_new(NULL);
-	purple_request_fields_add_group(fields, group);
+	group = purple_request_field_group_new( NULL );
+	purple_request_fields_add_group( fields, group );
 
 	/* pin */
 	field = purple_request_field_string_new( "pin", _( "PIN" ), purple_account_get_password( session->acc ), FALSE );
@@ -497,10 +497,10 @@ static void mxit_user_search_action( Pur
 		_( "Search for a MXit contact" ),
 		_( "Type search information" ),
 		NULL, FALSE, FALSE, NULL,
-		_("_Search"), G_CALLBACK( mxit_user_search_cb ),
-		_("_Cancel"), NULL,
+		_( "_Search" ), G_CALLBACK( mxit_user_search_cb ),
+		_( "_Cancel" ), NULL,
 		purple_connection_get_account( gc ), NULL, NULL,
-		gc);
+		gc );
 }
 
 
diff --git a/libpurple/protocols/mxit/formcmds.c b/libpurple/protocols/mxit/formcmds.c
--- a/libpurple/protocols/mxit/formcmds.c
+++ b/libpurple/protocols/mxit/formcmds.c
@@ -477,7 +477,7 @@ static void command_screeninfo(struct MX
  *   menu ::= <menuitem> { ";" <menuitem> }
  *     menuitem ::= { type "," <text> "," <name> "," <meta> }
  *   colors ::= <color> { ";" <color> }
- *     color ::= <colorid> "," <ARGB hex color>   
+ *     color ::= <colorid> "," <ARGB hex color>
  *
  *  @param session		The MXit session object
  *  @param from			The sender of the message.
@@ -532,7 +532,7 @@ static void command_table(struct RXMsgDa
 
 	/* number of columns */
 	tmp = g_hash_table_lookup(hash, "col");
-	nr_columns = atoi(tmp);	
+	nr_columns = atoi(tmp);
 
 	/* number of rows */
 	tmp = g_hash_table_lookup(hash, "row");
diff --git a/libpurple/protocols/mxit/markup.c b/libpurple/protocols/mxit/markup.c
--- a/libpurple/protocols/mxit/markup.c
+++ b/libpurple/protocols/mxit/markup.c
@@ -391,7 +391,7 @@ void mxit_show_message( struct RXMsgData
 			if ( end == mx->msg->len )			/* end of emoticon tag not found */
 				break;
 
-			ii = g_strndup(&mx->msg->str[emo_ofs], end - emo_ofs);
+			ii = g_strndup( &mx->msg->str[emo_ofs], end - emo_ofs );
 
 			/* remove inline image tag */
 			g_string_erase( mx->msg, start, ( end - start ) + 1 );
@@ -408,7 +408,7 @@ void mxit_show_message( struct RXMsgData
 				g_string_insert( mx->msg, start, tag );
 			}
 
-			g_free(ii);
+			g_free( ii );
 		}
 	}
 
diff --git a/libpurple/protocols/mxit/multimx.c b/libpurple/protocols/mxit/multimx.c
--- a/libpurple/protocols/mxit/multimx.c
+++ b/libpurple/protocols/mxit/multimx.c
@@ -310,7 +310,7 @@ void multimx_created(struct MXitSession*
 	multimx = find_room_by_username(session, contact->username);
 	if (multimx == NULL) {
 		multimx = room_create(session, contact->username, contact->alias, TRUE);
-		}
+	}
 	else if (multimx->state == STATE_INVITED) {
 		/* After successfully accepting an invitation */
 		multimx->state = STATE_JOINED;
diff --git a/libpurple/protocols/mxit/mxit.c b/libpurple/protocols/mxit/mxit.c
--- a/libpurple/protocols/mxit/mxit.c
+++ b/libpurple/protocols/mxit/mxit.c
@@ -129,7 +129,7 @@ skip:
 /*------------------------------------------------------------------------
  * Register MXit to receive URI click notifications from the UI
  */
-void mxit_register_uri_handler(void)
+void mxit_register_uri_handler( void )
 {
 	not_link_ref_count++;
 	if ( not_link_ref_count == 1 ) {
@@ -198,7 +198,7 @@ static void mxit_cb_chat_created( Purple
 	if ( !buddy )
 		return;
 
-	contact = purple_buddy_get_protocol_data(buddy);
+	contact = purple_buddy_get_protocol_data( buddy );
 	if ( !contact )
 		return;
 
@@ -214,7 +214,7 @@ static void mxit_cb_chat_created( Purple
 		case MXIT_TYPE_INFO :
 				tmp = g_strdup_printf("<font color=\"#999999\">%s</font>\n", _( "Loading menu..." ));
 				serv_got_im( session->con, who, tmp, PURPLE_MESSAGE_NOTIFY, time( NULL ) );
-				g_free(tmp);
+				g_free( tmp );
 				mxit_send_message( session, who, " ", FALSE, FALSE );
 		default :
 				break;
@@ -268,7 +268,7 @@ static const char* mxit_list_icon( Purpl
  */
 static const char* mxit_list_emblem( PurpleBuddy* buddy )
 {
-	struct contact*	contact = purple_buddy_get_protocol_data(buddy);
+	struct contact*	contact = purple_buddy_get_protocol_data( buddy );
 
 	if ( !contact )
 		return NULL;
@@ -310,7 +310,7 @@ static const char* mxit_list_emblem( Pur
 char* mxit_status_text( PurpleBuddy* buddy )
 {
 	char* text = NULL;
-	struct contact*	contact = purple_buddy_get_protocol_data(buddy);
+	struct contact*	contact = purple_buddy_get_protocol_data( buddy );
 
 	if ( !contact )
 		return NULL;
@@ -333,7 +333,7 @@ char* mxit_status_text( PurpleBuddy* bud
  */
 static void mxit_tooltip( PurpleBuddy* buddy, PurpleNotifyUserInfo* info, gboolean full )
 {
-	struct contact*	contact = purple_buddy_get_protocol_data(buddy);
+	struct contact*	contact = purple_buddy_get_protocol_data( buddy );
 
 	if ( !contact )
 		return;
@@ -424,7 +424,7 @@ static void mxit_set_status( PurpleAccou
 	char*					statusmsg2;
 
 	/* Handle mood changes */
-	if (purple_status_type_get_primitive(purple_status_get_type(status)) == PURPLE_STATUS_MOOD) {
+	if ( purple_status_type_get_primitive( purple_status_get_type( status ) ) == PURPLE_STATUS_MOOD ) {
 		const char* moodid = purple_status_get_attr_string( status, PURPLE_MOOD_NAME );
 		int mood;
 
@@ -487,7 +487,7 @@ static void mxit_free_buddy( PurpleBuddy
 
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_free_buddy\n" );
 
-	contact = purple_buddy_get_protocol_data(buddy);
+	contact = purple_buddy_get_protocol_data( buddy );
 	if ( contact ) {
 		if ( contact->statusMsg )
 			g_free( contact->statusMsg );
@@ -498,7 +498,7 @@ static void mxit_free_buddy( PurpleBuddy
 		g_free( contact );
 	}
 
-	purple_buddy_set_protocol_data(buddy, NULL);
+	purple_buddy_set_protocol_data( buddy, NULL );
 }
 
 
@@ -644,7 +644,7 @@ static GList* mxit_blist_menu( PurpleBli
 	if ( ( contact->subtype == MXIT_SUBTYPE_DELETED ) || ( contact->subtype == MXIT_SUBTYPE_REJECTED ) || ( contact->subtype == MXIT_SUBTYPE_NONE ) ) {
 		/* contact is in Deleted, Rejected or None state */
 		act = purple_menu_action_new( _( "Re-Invite" ), PURPLE_CALLBACK( mxit_reinvite ), NULL, NULL );
-		m = g_list_append(m, act);
+		m = g_list_append( m, act );
 	}
 
 	return m;
diff --git a/libpurple/protocols/mxit/mxit.h b/libpurple/protocols/mxit/mxit.h
--- a/libpurple/protocols/mxit/mxit.h
+++ b/libpurple/protocols/mxit/mxit.h
@@ -191,7 +191,7 @@ char* mxit_status_text( PurpleBuddy* bud
 void mxit_enable_signals( struct MXitSession* session );
 
 #ifdef	MXIT_LINK_CLICK
-void mxit_register_uri_handler(void);
+void mxit_register_uri_handler( void );
 #endif
 
 
diff --git a/libpurple/protocols/mxit/profile.c b/libpurple/protocols/mxit/profile.c
--- a/libpurple/protocols/mxit/profile.c
+++ b/libpurple/protocols/mxit/profile.c
@@ -153,18 +153,18 @@ static int calculateAge( const char* dat
 		return 0;
 
 	/* current time */
-	t = time(NULL);
+	t = time( NULL );
 	localtime_r( &t, &now );
 
 	/* decode hdate */
 	memset( &bdate, 0, sizeof( struct tm ) );
-	purple_str_to_time(date, FALSE, &bdate, NULL, NULL);
+	purple_str_to_time( date, FALSE, &bdate, NULL, NULL );
 
 	/* calculate difference */
 	age = now.tm_year - bdate.tm_year;
 	if ( now.tm_mon < bdate.tm_mon )		/* is before month of birth */
 		age--;
-	else if ( (now.tm_mon == bdate.tm_mon ) && ( now.tm_mday < bdate.tm_mday ) )	/* before birthday in current month */
+	else if ( ( now.tm_mon == bdate.tm_mon ) && ( now.tm_mday < bdate.tm_mday ) )	/* before birthday in current month */
 		age--;
 
 	return age;
@@ -206,7 +206,7 @@ void mxit_show_profile( struct MXitSessi
 	if ( buddy ) {
 		purple_notify_user_info_add_pair( info, _( "Alias" ), purple_buddy_get_alias( buddy ) );
 		purple_notify_user_info_add_section_break( info );
-		contact = purple_buddy_get_protocol_data(buddy);
+		contact = purple_buddy_get_protocol_data( buddy );
 	}
 
 	purple_notify_user_info_add_pair( info, _( "Display Name" ), profile->nickname );
@@ -332,7 +332,7 @@ void mxit_show_search_results( struct MX
 	column = purple_notify_searchresults_column_new( _( "Where I live" ) );
 	purple_notify_searchresults_column_add( results, column );
 
-	while (entries != NULL) {
+	while ( entries != NULL ) {
 		struct MXitProfile* profile	= ( struct MXitProfile *) entries->data;
 		GList*	row;
 		gchar* tmp = purple_base64_encode( (unsigned char *) profile->userid, strlen( profile->userid ) );
@@ -362,5 +362,5 @@ void mxit_show_search_results( struct MX
 
 	purple_notify_searchresults( session->con, NULL, text, NULL, results, NULL, NULL );
 
-	g_free( text);
+	g_free( text );
 }
diff --git a/libpurple/protocols/mxit/protocol.c b/libpurple/protocols/mxit/protocol.c
--- a/libpurple/protocols/mxit/protocol.c
+++ b/libpurple/protocols/mxit/protocol.c
@@ -86,7 +86,7 @@ void mxit_popup( int type, const char* h
 void mxit_strip_domain( char* username )
 {
 	if ( g_str_has_suffix( username, "@m" ) )
-		username[ strlen(username) - 2 ] = '\0';
+		username[ strlen( username ) - 2 ] = '\0';
 }
 
 
@@ -707,9 +707,9 @@ void mxit_send_register( struct MXitSess
 	locale = purple_account_get_string( session->acc, MXIT_CONFIG_LOCALE, MXIT_DEFAULT_LOCALE );
 
 	/* Voice and Video supported */
-	if (mxit_audio_enabled() && mxit_video_enabled())
-		features |= (MXIT_CF_VOICE | MXIT_CF_VIDEO);
-	else if (mxit_audio_enabled())
+	if ( mxit_audio_enabled() && mxit_video_enabled() )
+		features |= ( MXIT_CF_VOICE | MXIT_CF_VIDEO );
+	else if ( mxit_audio_enabled() )
 		features |= MXIT_CF_VOICE;
 
 	/* generate client version string (eg, P-2.7.10-Y-PURPLE) */
@@ -751,8 +751,8 @@ void mxit_send_login( struct MXitSession
 	locale = purple_account_get_string( session->acc, MXIT_CONFIG_LOCALE, MXIT_DEFAULT_LOCALE );
 
 	/* Voice and Video supported */
-	if (mxit_audio_enabled() && mxit_video_enabled())
-		features |= (MXIT_CF_VOICE | MXIT_CF_VIDEO);
+	if ( mxit_audio_enabled() && mxit_video_enabled() )
+		features |= ( MXIT_CF_VOICE | MXIT_CF_VIDEO );
 	else if (mxit_audio_enabled())
 		features |= MXIT_CF_VOICE;
 
@@ -1150,7 +1150,7 @@ void mxit_send_splashclick( struct MXitS
  *  @param id			The identifier of the event (received in message)
  *  @param event		Identified the type of event
  */
-void mxit_send_msgevent( struct MXitSession* session, const char* to, const char* id, int event)
+void mxit_send_msgevent( struct MXitSession* session, const char* to, const char* id, int event )
 {
 	char		data[CP_MAX_PACKET];
 	int			datalen;
@@ -2061,7 +2061,7 @@ static void mxit_parse_cmd_msgevent( str
 	int event;
 
 	/*
-	 * contactAddress \1 dateTime \1 id \1 event 
+	 * contactAddress \1 dateTime \1 id \1 event
 	 */
 
 	/* strip off dummy domain */



More information about the Commits mailing list