# HG changeset patch # User Matti Hamalainen # Date 1352134053 -7200 # Node ID 64e7e427a4360981edb437180c43bf6693817369 # Parent 55eea3fa8868048078855ea265bcc98cdffcd155 Cosmetics. diff -r 55eea3fa8868 -r 64e7e427a436 src/xmms-sid.h --- a/src/xmms-sid.h Mon Nov 05 18:42:57 2012 +0200 +++ b/src/xmms-sid.h Mon Nov 05 18:47:33 2012 +0200 @@ -54,7 +54,7 @@ #undef HAVE_HARDSID_BUILDER /* Size for some small buffers (always static variables) */ -#define XS_BUF_SIZE (1024) +#define XS_BUF_SIZE (1024) /* If defined, some dynamically allocated temp. buffers are used. * Static (#undef) might give slight performance gain, @@ -63,65 +63,65 @@ /* Configuration section identifier */ -#define XS_PACKAGE_STRING PACKAGE_STRING +#define XS_PACKAGE_STRING PACKAGE_STRING #define XS_CONFIG_IDENT "XMMS-SID" /* Default audio rendering frequency in Hz */ -#define XS_AUDIO_FREQ (44100) +#define XS_AUDIO_FREQ (44100) /* Size of audio buffer. If you are experiencing lots of audio * "underruns" or clicks/gaps in output, try increasing this value. * Do notice, however, that it also affects the update frequency of * XMMS's visualization plugins... */ -#define XS_AUDIOBUF_SIZE (2*1024) +#define XS_AUDIOBUF_SIZE (2*1024) /* Size of data buffer used for SID-tune MD5 hash calculation. * If this is too small, the computed hash will be incorrect. * Largest SID files I've seen are ~70kB. */ -#define XS_SIDBUF_SIZE (80*1024) +#define XS_SIDBUF_SIZE (80*1024) /* libSIDPlay1/2 constants (copied from internal headers/source) * For some stupid reason these are not available in public * headers, so we have to duplicate them here... */ -#define XS_SIDPLAY1_FS (400.0f) -#define XS_SIDPLAY1_FM (60.0f) -#define XS_SIDPLAY1_FT (0.05f) +#define XS_SIDPLAY1_FS (400.0f) +#define XS_SIDPLAY1_FM (60.0f) +#define XS_SIDPLAY1_FT (0.05f) -#define XS_SIDPLAY2_NFPOINTS (0x800) -#define XS_SIDPLAY2_FMAX (24000) +#define XS_SIDPLAY2_NFPOINTS (0x800) +#define XS_SIDPLAY2_FMAX (24000) /* Macros for mutexes and threads. These exist to be able to * easily change from pthreads to glib threads, etc, if necessary. */ -#define XS_THREAD_T pthread_t -#define XS_THREAD_EXIT(M) pthread_exit(M) -#define XS_THREAD_JOIN(M) pthread_join(M, NULL) -#define XS_MPP(M) M ## _mutex +#define XS_THREAD_T pthread_t +#define XS_THREAD_EXIT(M) pthread_exit(M) +#define XS_THREAD_JOIN(M) pthread_join(M, NULL) +#define XS_MPP(M) M ## _mutex #ifdef XS_MUTEX_DEBUG # ifndef __USE_GNU # define __USE_GNU # endif -# define XS_MUTEX(M) pthread_mutex_t XS_MPP(M) = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP; gint M ## _qq +# define XS_MUTEX(M) pthread_mutex_t XS_MPP(M) = PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP; gint M ## _qq # define XS_MUTEX_H(M) extern pthread_mutex_t XS_MPP(M); extern gint M ## _qq -# define XS_MUTEX_LOCK(M) { M ## _qq = pthread_mutex_lock(&XS_MPP(M)); if (M ## _qq) XSDEBUG("XS_MUTEX_LOCK(" #M ") == %i\n", M ## _qq); } -# define XS_MUTEX_UNLOCK(M) { M ## _qq = pthread_mutex_unlock(&XS_MPP(M)); if (M ## _qq) XSDEBUG("XS_MUTEX_UNLOCK(" #M ") == %i\n", M ## _qq); } +# define XS_MUTEX_LOCK(M) { M ## _qq = pthread_mutex_lock(&XS_MPP(M)); if (M ## _qq) XSDEBUG("XS_MUTEX_LOCK(" #M ") == %i\n", M ## _qq); } +# define XS_MUTEX_UNLOCK(M) { M ## _qq = pthread_mutex_unlock(&XS_MPP(M)); if (M ## _qq) XSDEBUG("XS_MUTEX_UNLOCK(" #M ") == %i\n", M ## _qq); } #else -# define XS_MUTEX(M) pthread_mutex_t XS_MPP(M) = PTHREAD_MUTEX_INITIALIZER +# define XS_MUTEX(M) pthread_mutex_t XS_MPP(M) = PTHREAD_MUTEX_INITIALIZER # define XS_MUTEX_H(M) extern pthread_mutex_t XS_MPP(M) -# define XS_MUTEX_LOCK(M) pthread_mutex_lock(&XS_MPP(M)) -# define XS_MUTEX_UNLOCK(M) pthread_mutex_unlock(&XS_MPP(M)) +# define XS_MUTEX_LOCK(M) pthread_mutex_lock(&XS_MPP(M)) +# define XS_MUTEX_UNLOCK(M) pthread_mutex_unlock(&XS_MPP(M)) #endif #include /* Character set conversion helper macros */ -#define XS_CS_FILENAME(M) g_strdup(M) -#define XS_CS_SID(M) g_strdup(M) -#define XS_CS_STIL(M) M +#define XS_CS_FILENAME(M) g_strdup(M) +#define XS_CS_SID(M) g_strdup(M) +#define XS_CS_STIL(M) M #define XS_CS_FREE(M) /* Shorthands for linked lists @@ -134,24 +134,24 @@ /* Plugin-wide typedefs */ typedef struct { - gint tuneSpeed, - tuneLength; - gboolean tunePlayed; + gint tuneSpeed, + tuneLength; + gboolean tunePlayed; } XSSubTuneInfo; typedef struct { gchar *sidFilename, - *sidName, - *sidComposer, - *sidCopyright, - *sidFormat; - gint loadAddr, - initAddr, - playAddr, - dataFileLen, - sidModel; - gint nsubTunes, startTune; + *sidName, + *sidComposer, + *sidCopyright, + *sidFormat; + gint loadAddr, + initAddr, + playAddr, + dataFileLen, + sidModel; + gint nsubTunes, startTune; XSSubTuneInfo *subTunes; } XSTuneInfo; @@ -193,24 +193,24 @@ /* And even some Gtk+ macro crap here, yay. */ -#define XS_DEF_WINDOW_DELETE(ME, MV) \ -gboolean xs_ ## ME ## _delete(GtkWidget *w, GdkEvent *e, gpointer d) { \ - (void) w; (void) e; (void) d; \ - if (xs_ ## MV ) { \ - gtk_widget_destroy(xs_ ## MV ); \ - xs_ ## MV = NULL; \ - } \ - return FALSE; \ +#define XS_DEF_WINDOW_DELETE(ME, MV) \ +gboolean xs_ ## ME ## _delete(GtkWidget *w, GdkEvent *e, gpointer d) { \ + (void) w; (void) e; (void) d; \ + if (xs_ ## MV ) { \ + gtk_widget_destroy(xs_ ## MV ); \ + xs_ ## MV = NULL; \ + } \ + return FALSE; \ } -#define XS_DEF_WINDOW_CLOSE(ME, MV) \ -void xs_ ## ME (GtkButton *b, gpointer d) { \ - (void) b; (void) d; \ - gtk_widget_destroy(xs_ ## MV ); \ - xs_ ## MV = NULL; \ +#define XS_DEF_WINDOW_CLOSE(ME, MV) \ +void xs_ ## ME (GtkButton *b, gpointer d) { \ + (void) b; (void) d; \ + gtk_widget_destroy(xs_ ## MV ); \ + xs_ ## MV = NULL; \ } -#define XS_SIGNAL_CONNECT(SOBJ, SNAME, SFUNC, SDATA) \ +#define XS_SIGNAL_CONNECT(SOBJ, SNAME, SFUNC, SDATA) \ gtk_signal_connect(GTK_OBJECT(SOBJ), SNAME, GTK_SIGNAL_FUNC(SFUNC), SDATA) #define XS_WINDOW_PRESENT(SWIN) gdk_window_raise(SWIN ->window) diff -r 55eea3fa8868 -r 64e7e427a436 src/xs_about.c --- a/src/xs_about.c Mon Nov 05 18:42:57 2012 +0200 +++ b/src/xs_about.c Mon Nov 05 18:47:33 2012 +0200 @@ -37,15 +37,15 @@ */ gint xs_about_theme(void) { - const gint iSession = 0; /* Assume session 0 */ - gint iPos; + const gint session = 0; /* Assume session 0 */ + gint pos; /* Stop current song, add theme to playlist, play. */ - xmms_remote_stop(iSession); - iPos = xmms_remote_get_playlist_length(iSession); - xmms_remote_playlist_add_url_string(iSession, THEMETUNE_FILE); - xmms_remote_set_playlist_pos(iSession, iPos); - xmms_remote_play(iSession); + xmms_remote_stop(session); + pos = xmms_remote_get_playlist_length(session); + xmms_remote_playlist_add_url_string(session, THEMETUNE_FILE); + xmms_remote_set_playlist_pos(session, pos); + xmms_remote_play(session); return 0; } #endif