# HG changeset patch # User Matti Hamalainen # Date 1211668728 -10800 # Node ID b5b6b13a6d859374debff7c1527ddbcdd9068186 # Parent f2037b4d2c23e90afca8978eb3581ece99f05176 Renamed some types. diff -r f2037b4d2c23 -r b5b6b13a6d85 src/xs_config.c --- a/src/xs_config.c Fri May 23 21:05:47 2008 +0300 +++ b/src/xs_config.c Sun May 25 01:38:48 2008 +0300 @@ -84,9 +84,9 @@ * Configuration specific stuff */ XS_MUTEX(xs_cfg); -struct t_xs_cfg xs_cfg; +struct xs_cfg_t xs_cfg; -static t_xs_cfg_item xs_cfgtable[] = { +static xs_cfg_item_t xs_cfgtable[] = { { CTYPE_INT, &xs_cfg.audioBitsPerSample, "audioBitsPerSample" }, { CTYPE_INT, &xs_cfg.audioChannels, "audioChannels" }, { CTYPE_INT, &xs_cfg.audioFrequency, "audioFrequency" }, @@ -135,10 +135,10 @@ { CTYPE_INT, &xs_cfg.subAutoMinTime, "subAutoMinTime" }, }; -static const gint xs_cfgtable_max = (sizeof(xs_cfgtable) / sizeof(t_xs_cfg_item)); +static const gint xs_cfgtable_max = (sizeof(xs_cfgtable) / sizeof(xs_cfgtable[0])); -static t_xs_wid_item xs_widtable[] = { +static xs_wid_item_t xs_widtable[] = { { WTYPE_BGROUP, CTYPE_INT, "cfg_res_16bit", &xs_cfg.audioBitsPerSample, XS_RES_16BIT }, { WTYPE_BGROUP, CTYPE_INT, "cfg_res_8bit", &xs_cfg.audioBitsPerSample, XS_RES_8BIT }, { WTYPE_BGROUP, CTYPE_INT, "cfg_chn_mono", &xs_cfg.audioChannels, XS_CHN_MONO }, @@ -199,7 +199,7 @@ { WTYPE_SPIN, CTYPE_INT, "cfg_subauto_mintime", &xs_cfg.subAutoMinTime, 0 }, }; -static const gint xs_widtable_max = (sizeof(xs_widtable) / sizeof(t_xs_wid_item)); +static const gint xs_widtable_max = (sizeof(xs_widtable) / sizeof(xs_widtable[0])); /* Reset/initialize the configuration @@ -304,7 +304,7 @@ */ #define XS_FITEM (4 * 2) -static gboolean xs_filter_load_into(XS_CONFIG_FILE *cfg, gint nFilter, t_xs_sid2_filter *pResult) +static gboolean xs_filter_load_into(XS_CONFIG_FILE *cfg, gint nFilter, xs_sid2_filter_t *pResult) { gchar tmpKey[64], *tmpStr; gint i, j; @@ -339,12 +339,12 @@ } -static t_xs_sid2_filter * xs_filter_load(XS_CONFIG_FILE *cfg, gint nFilter) +static xs_sid2_filter_t * xs_filter_load(XS_CONFIG_FILE *cfg, gint nFilter) { - t_xs_sid2_filter *pResult; + xs_sid2_filter_t *pResult; /* Allocate filter struct */ - if ((pResult = g_malloc0(sizeof(t_xs_sid2_filter))) == NULL) + if ((pResult = g_malloc0(sizeof(xs_sid2_filter_t))) == NULL) return NULL; if (!xs_filter_load_into(cfg, nFilter, pResult)) { @@ -355,7 +355,7 @@ } #if 0 -static gboolean xs_filter_save(XS_CONFIG_FILE *cfg, t_xs_sid2_filter *pFilter, gint nFilter) +static gboolean xs_filter_save(XS_CONFIG_FILE *cfg, xs_sid2_filter_t *pFilter, gint nFilter) { gchar *tmpValue, tmpKey[64]; gint i, j; @@ -402,14 +402,14 @@ return (inLine[*linePos] == sep); } -static gboolean xs_filters_import(const gchar *pcFilename, t_xs_sid2_filter **pFilters, gint *nFilters) +static gboolean xs_filters_import(const gchar *pcFilename, xs_sid2_filter_t **pFilters, gint *nFilters) { FILE *inFile; gchar inLine[XS_BUF_SIZE], tmpStr[XS_BUF_SIZE]; gchar *sectName = NULL; gboolean sectBegin; size_t lineNum, i; - t_xs_sid2_filter *tmpFilter; + xs_sid2_filter_t *tmpFilter; fprintf(stderr, "xs_filters_import(%s)\n", pcFilename); @@ -446,7 +446,7 @@ if (sectBegin) { /* Submit definition */ fprintf(stderr, "filter ends: %s\n", sectName); - if ((tmpFilter = g_malloc0(sizeof(t_xs_sid2_filter))) == NULL) { + if ((tmpFilter = g_malloc0(sizeof(xs_sid2_filter_t))) == NULL) { fprintf(stderr, "could not allocate ..\n"); } else { @@ -478,10 +478,10 @@ } -static gboolean xs_filters_export(const gchar *pcFilename, t_xs_sid2_filter **pFilters, gint nFilters) +static gboolean xs_filters_export(const gchar *pcFilename, xs_sid2_filter_t **pFilters, gint nFilters) { FILE *outFile; - t_xs_sid2_filter *f; + xs_sid2_filter_t *f; gint n; /* Open/create the file */ @@ -575,7 +575,7 @@ xs_filter_load_into(cfg, 0, &xs_cfg.sid2Filter); if (xs_cfg.sid2NFilterPresets > 0) { - xs_cfg.sid2FilterPresets = g_malloc0(xs_cfg.sid2NFilterPresets * sizeof(t_xs_sid2_filter *)); + xs_cfg.sid2FilterPresets = g_malloc0(xs_cfg.sid2NFilterPresets * sizeof(xs_sid2_filter_t *)); if (!xs_cfg.sid2FilterPresets) { xs_error("Allocation of sid2FilterPresets structure failed!\n"); } else { @@ -896,7 +896,7 @@ } -void xs_cfg_sp2_filter_update(XSCurve *curve, t_xs_sid2_filter *f) +void xs_cfg_sp2_filter_update(XSCurve *curve, xs_sid2_filter_t *f) { assert(curve); assert(f); diff -r f2037b4d2c23 -r b5b6b13a6d85 src/xs_config.h --- a/src/xs_config.h Fri May 23 21:05:47 2008 +0300 +++ b/src/xs_config.h Sun May 25 01:38:48 2008 +0300 @@ -68,13 +68,14 @@ typedef struct { - t_xs_int_point points[XS_SIDPLAY2_NFPOINTS]; - gint npoints; - gchar *name; -} t_xs_sid2_filter; + gint type; + xs_int_point_t points[XS_SIDPLAY2_NFPOINTS]; + gint npoints; + gchar *name; +} xs_sid2_filter_t; -extern struct t_xs_cfg { +extern struct xs_cfg_t { /* General audio settings */ gint audioBitsPerSample; gint audioChannels; @@ -99,8 +100,8 @@ gint sid2OptLevel; /* SIDPlay2 emulation optimization */ gint sid2Builder; /* SIDPlay2 "builder" aka SID-emu */ - t_xs_sid2_filter sid2Filter; /* Current SIDPlay2 filter */ - t_xs_sid2_filter **sid2FilterPresets; + xs_sid2_filter_t sid2Filter; /* Current SIDPlay2 filter */ + xs_sid2_filter_t **sid2FilterPresets; gint sid2NFilterPresets; @@ -158,7 +159,7 @@ gint itemType; /* Type of item (CTYPE_*) */ void *itemData; /* Pointer to variable */ gchar *itemName; /* Name of configuration item */ -} t_xs_cfg_item; +} xs_cfg_item_t; typedef struct { @@ -167,7 +168,7 @@ gchar *widName; void *itemData; gint itemSet; -} t_xs_wid_item; +} xs_wid_item_t; /* Functions diff -r f2037b4d2c23 -r b5b6b13a6d85 src/xs_curve.c --- a/src/xs_curve.c Fri May 23 21:05:47 2008 +0300 +++ b/src/xs_curve.c Sun May 25 01:38:48 2008 +0300 @@ -210,7 +210,7 @@ GtkStateType state; GtkStyle *style; gint i, ox = -1, oy = -1; - t_xs_point *p0, *p1, *p2, *p3; + xs_point_t *p0, *p1, *p2, *p3; if (!curve->pixmap) return; @@ -568,7 +568,7 @@ { if (npoints != curve->nctlpoints) { curve->nctlpoints = npoints; - curve->ctlpoints = (t_xs_point *) g_realloc(curve->ctlpoints, + curve->ctlpoints = (xs_point_t *) g_realloc(curve->ctlpoints, curve->nctlpoints * sizeof(*curve->ctlpoints)); if (curve->ctlpoints == NULL) @@ -579,14 +579,14 @@ } -void xs_curve_get_data(XSCurve *curve, t_xs_point ***points, gint **npoints) +void xs_curve_get_data(XSCurve *curve, xs_point_t ***points, gint **npoints) { *points = &(curve->ctlpoints); *npoints = &(curve->nctlpoints); } -gboolean xs_curve_set_points(XSCurve *curve, t_xs_int_point *points, gint npoints) +gboolean xs_curve_set_points(XSCurve *curve, xs_int_point_t *points, gint npoints) { gint i; @@ -613,13 +613,13 @@ } -gboolean xs_curve_get_points(XSCurve *curve, t_xs_int_point **points, gint *npoints) +gboolean xs_curve_get_points(XSCurve *curve, xs_int_point_t **points, gint *npoints) { gint i, n; n = curve->nctlpoints - 4; - *points = g_malloc(n * sizeof(t_xs_int_point)); + *points = g_malloc(n * sizeof(xs_int_point_t)); if (*points == NULL) return FALSE; diff -r f2037b4d2c23 -r b5b6b13a6d85 src/xs_curve.h --- a/src/xs_curve.h Fri May 23 21:05:47 2008 +0300 +++ b/src/xs_curve.h Sun May 25 01:38:48 2008 +0300 @@ -24,11 +24,11 @@ typedef struct { gfloat x,y; -} t_xs_point; +} xs_point_t; typedef struct { gint x, y; -} t_xs_int_point; +} xs_int_point_t; struct _XSCurve { GtkDrawingArea graph; @@ -43,7 +43,7 @@ /* control points */ gint nctlpoints; /* number of control points */ - t_xs_point *ctlpoints; /* array of control points */ + xs_point_t *ctlpoints; /* array of control points */ }; struct _XSCurveClass { @@ -58,9 +58,9 @@ gfloat min_x, gfloat min_y, gfloat max_x, gfloat max_y); gboolean xs_curve_realloc_data (XSCurve *curve, gint npoints); -void xs_curve_get_data (XSCurve *curve, t_xs_point ***points, gint **npoints); -gboolean xs_curve_set_points (XSCurve *curve, t_xs_int_point *points, gint npoints); -gboolean xs_curve_get_points (XSCurve *curve, t_xs_int_point **points, gint *npoints); +void xs_curve_get_data (XSCurve *curve, xs_point_t ***points, gint **npoints); +gboolean xs_curve_set_points (XSCurve *curve, xs_int_point_t *points, gint npoints); +gboolean xs_curve_get_points (XSCurve *curve, xs_int_point_t **points, gint *npoints); #ifdef __cplusplus } diff -r f2037b4d2c23 -r b5b6b13a6d85 src/xs_sidplay2.cc --- a/src/xs_sidplay2.cc Fri May 23 21:05:47 2008 +0300 +++ b/src/xs_sidplay2.cc Sun May 25 01:38:48 2008 +0300 @@ -94,7 +94,7 @@ */ gboolean xs_sidplay2_probe(xs_file_t *f) { - gchar tmpBuf[4]; + gchar tmpBuf[5]; if (!f) return FALSE; @@ -115,7 +115,7 @@ gint tmpFreq, i; xs_sidplay2_t *myEngine; sid_filter_t tmpFilter; - t_xs_sid2_filter *f; + xs_sid2_filter_t *f; assert(myStatus); /* Allocate internal structures */