13
0

Fix some compilation warnings

This commit is contained in:
Julien de Kozak 2013-03-24 14:55:56 +01:00
parent deaceb4727
commit 27d77b8719
18 changed files with 36 additions and 104 deletions

View File

@ -39,7 +39,7 @@
#define POSIX_FUNC_PTR_CAST(type, object) *((type*) &(object))
#endif // _POSIX_VERSION
extern void c_stacktrace();
extern void c_stacktrace(void);
enum {
PROP_0,
@ -338,7 +338,7 @@ gnome_canvas_waveview_set_gradient_waveforms (int yn)
}
GnomeCanvasWaveViewCache*
gnome_canvas_waveview_cache_new ()
gnome_canvas_waveview_cache_new (void)
{
GnomeCanvasWaveViewCache *c;

View File

@ -61,7 +61,7 @@ struct _GnomeCanvasWaveViewCache
gulong end;
};
GnomeCanvasWaveViewCache* gnome_canvas_waveview_cache_new ();
GnomeCanvasWaveViewCache* gnome_canvas_waveview_cache_new (void);
void gnome_canvas_waveview_cache_destroy (GnomeCanvasWaveViewCache*);
void gnome_canvas_waveview_set_gradient_waveforms (int);

View File

@ -129,7 +129,6 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
//cout << endl << "*** LINE CACHE MISS" << endl;
bool inserted_last_time = true;
bool invalidated = false;
for (i = begin; i != end; ++i) {
@ -162,7 +161,6 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
++li;
line->property_color_rgba() = color;
inserted_last_time = false; // don't search next time
// Use existing line, moving if necessary
} else if (!exhausted) {
Lines::iterator steal = _lines.end();
@ -178,7 +176,6 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
line->property_x2() = xpos;
line->property_color_rgba() = color;
_lines.insert(make_pair(xpos, line));
inserted_last_time = true; // search next time
invalidated = true;
// Shift clean range left
@ -192,7 +189,6 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
//cout << "*** EXISTING LINE" << endl;
li = existing;
li->second->property_color_rgba() = color;
inserted_last_time = false; // don't search next time
} else {
//cout << "*** MOVING LINE" << endl;
const double x1 = line->property_x1();
@ -206,7 +202,6 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
line->property_x1() = xpos;
line->property_x2() = xpos;
_lines.insert(make_pair(xpos, line));
inserted_last_time = true; // search next time
}
}
@ -222,7 +217,6 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
line->property_y2() = _height;
line->property_color_rgba() = color;
_lines.insert(make_pair(xpos, line));
inserted_last_time = true;
}
// Steal from the left
@ -237,7 +231,6 @@ TempoLines::draw (const ARDOUR::TempoMap::BBTPointList::const_iterator& begin,
line->property_x1() = xpos;
line->property_x2() = xpos;
_lines.insert(make_pair(xpos, line));
inserted_last_time = true; // search next time
invalidated = true;
// Shift clean range right

View File

@ -1570,7 +1570,6 @@ LV2Plugin::connect_and_run(BufferSet& bufs,
: m;
// Now merge MIDI and any transport events into the buffer
LV2_Evbuf_Iterator i = lv2_evbuf_end(_ev_buffers[port_index]);
const uint32_t type = LV2Plugin::urids.midi_MidiEvent;
const framepos_t tend = _session.transport_frame() + nframes;
++metric_i;

View File

@ -63,7 +63,7 @@ force_widget_redraw (GtkWidget *widget)
/* ensures that the timer is running */
static void
start_timer ()
start_timer (void)
{
if (animation_timer_id == 0)
animation_timer_id = g_timeout_add (ANIMATION_DELAY, animation_timeout_handler, NULL);
@ -71,7 +71,7 @@ start_timer ()
/* ensures that the timer is stopped */
static void
stop_timer ()
stop_timer (void)
{
if (animation_timer_id != 0)
{
@ -243,7 +243,7 @@ on_connected_widget_destruction (gpointer data, GObject *widget)
}
static void
disconnect_all_signals ()
disconnect_all_signals (void)
{
GSList * item = connected_widgets;
while (item != NULL)
@ -265,7 +265,7 @@ disconnect_all_signals ()
static gint
find_signal_info (gconstpointer signal_info, gconstpointer widget)
{
if (((SignalInfo*)signal_info)->widget == widget)
if (((const SignalInfo*)signal_info)->widget == widget)
return 0;
else
return 1;
@ -325,7 +325,7 @@ clearlooks_animation_elapsed (gpointer data)
/* cleans up all resources of the animation system */
void
clearlooks_animation_cleanup ()
clearlooks_animation_cleanup (void)
{
disconnect_all_signals ();

View File

@ -30,5 +30,5 @@ GE_INTERNAL void clearlooks_animation_progressbar_add (GtkWidget *progressba
GE_INTERNAL void clearlooks_animation_connect_checkbox (GtkWidget *widget);
GE_INTERNAL gboolean clearlooks_animation_is_animated (GtkWidget *widget);
GE_INTERNAL gdouble clearlooks_animation_elapsed (gpointer data);
GE_INTERNAL void clearlooks_animation_cleanup ();
GE_INTERNAL void clearlooks_animation_cleanup (void);
#endif /* HAVE_ANIMATION */

View File

@ -1088,7 +1088,7 @@ clearlooks_draw_frame (cairo_t *cr,
int x, int y, int width, int height)
{
const CairoColor *border = frame->border;
const CairoColor *dark = (CairoColor*)&colors->shade[4];
const CairoColor *dark = (const CairoColor*)&colors->shade[4];
ClearlooksRectangle bevel_clip = {0, 0, 0, 0};
ClearlooksRectangle frame_clip = {0, 0, 0, 0};
double radius = MIN (params->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
@ -1623,7 +1623,6 @@ clearlooks_draw_scrollbar_stepper (cairo_t *cr,
CairoColor border;
CairoColor s1, s2, s3, s4;
cairo_pattern_t *pattern;
ShadowParameters shadow;
double radius = MIN (widget->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
ge_shade_color(&colors->shade[6], 1.05, &border);
@ -1675,12 +1674,6 @@ clearlooks_draw_scrollbar_stepper (cairo_t *cr,
cairo_stroke (cr);
cairo_translate (cr, 0.5, 0.5);
shadow.shadow = CL_SHADOW_OUT;
shadow.corners = corners;
/*
clearlooks_draw_highlight_and_shade (cr, &shadow,
width,
height, params->radius);*/
}
static void
@ -1892,17 +1885,14 @@ clearlooks_draw_handle (cairo_t *cr,
{
const CairoColor *fill = &colors->bg[params->state_type];
int num_bars = 6; /* shut up gcc warnings */
int bar_spacing;
switch (handle->type)
{
case CL_HANDLE_TOOLBAR:
num_bars = 6;
bar_spacing = 3;
break;
case CL_HANDLE_SPLITTER:
num_bars = 16;
bar_spacing = 3;
break;
}

View File

@ -688,7 +688,6 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
cairo_pattern_t *pattern;
double radius;
double strip_size;
radius = MIN (params->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
@ -707,7 +706,6 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
if (tab->gap_side == CL_GAP_TOP || tab->gap_side == CL_GAP_BOTTOM)
{
height += 3.0;
strip_size = 2.0/height; /* 2 pixel high strip */
if (tab->gap_side == CL_GAP_TOP)
cairo_translate (cr, 0.0, -3.0); /* gap at the other side */
@ -715,7 +713,6 @@ clearlooks_glossy_draw_tab (cairo_t *cr,
else
{
width += 3.0;
strip_size = 2.0/width;
if (tab->gap_side == CL_GAP_LEFT)
cairo_translate (cr, -3.0, 0.0); /* gap at the other side */
@ -893,7 +890,6 @@ clearlooks_glossy_draw_scrollbar_stepper (cairo_t *cr,
const CairoColor *border = &colors->shade[7];
CairoColor fill, s1, s2, s4;
cairo_pattern_t *pattern;
ShadowParameters shadow;
double radius = MIN (widget->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
if (scrollbar->horizontal)
@ -944,8 +940,6 @@ clearlooks_glossy_draw_scrollbar_stepper (cairo_t *cr,
cairo_stroke (cr);
cairo_translate (cr, 0.5, 0.5);
shadow.shadow = CL_SHADOW_OUT;
shadow.corners = corners;
}
static void

View File

@ -665,7 +665,6 @@ clearlooks_gummy_draw_tab (cairo_t *cr,
cairo_pattern_t *pattern;
double radius;
double strip_size;
radius = MIN (params->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
@ -683,7 +682,6 @@ clearlooks_gummy_draw_tab (cairo_t *cr,
if (tab->gap_side == CL_GAP_TOP || tab->gap_side == CL_GAP_BOTTOM)
{
height += 3.0;
strip_size = 2.0/height; /* 2 pixel high strip */
if (tab->gap_side == CL_GAP_TOP)
cairo_translate (cr, 0.0, -3.0); /* gap at the other side */
@ -691,7 +689,6 @@ clearlooks_gummy_draw_tab (cairo_t *cr,
else
{
width += 3.0;
strip_size = 2.0/width;
if (tab->gap_side == CL_GAP_LEFT)
cairo_translate (cr, -3.0, 0.0); /* gap at the other side */
@ -927,7 +924,6 @@ clearlooks_gummy_draw_scrollbar_stepper (cairo_t *cr,
CairoColor fill;
CairoColor shade1, shade2, shade3;
cairo_pattern_t *pattern;
ShadowParameters shadow;
double radius = MIN (widget->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
if (scrollbar->horizontal)
@ -977,8 +973,6 @@ clearlooks_gummy_draw_scrollbar_stepper (cairo_t *cr,
cairo_stroke (cr);
cairo_translate (cr, 0.5, 0.5);
shadow.shadow = CL_SHADOW_OUT;
shadow.corners = corners;
}
static void

View File

@ -394,7 +394,7 @@ clearlooks_inverted_draw_menubaritem (cairo_t *cr,
const WidgetParameters *widget,
int x, int y, int width, int height)
{
CairoColor *fill = (CairoColor*)&colors->spot[1];
const CairoColor *fill = &colors->spot[1];
CairoColor fill_shade;
CairoColor border = colors->spot[2];
cairo_pattern_t *pattern;
@ -481,19 +481,6 @@ clearlooks_inverted_draw_tab (cairo_t *cr,
ge_shade_color (fill, 1.3, &hilight);
/* Draw highlight */
if (!params->active)
{
ShadowParameters shadow;
shadow.shadow = CL_SHADOW_OUT;
shadow.corners = params->corners;
/*
clearlooks_draw_highlight_and_shade (cr, colors, &shadow,
width,
height, radius);*/
}
if (params->active)
{
pattern = cairo_pattern_create_linear ( tab->gap_side == CL_GAP_LEFT ? width-1 : 0,
@ -761,7 +748,6 @@ clearlooks_inverted_draw_scrollbar_stepper (cairo_t *cr,
CairoColor border;
CairoColor s1, s2, s3;
cairo_pattern_t *pattern;
ShadowParameters shadow;
double radius = MIN (widget->radius, MIN ((width - 2.0) / 2.0, (height - 2.0) / 2.0));
ge_shade_color(&colors->shade[6], 1.05, &border);
@ -808,12 +794,6 @@ clearlooks_inverted_draw_scrollbar_stepper (cairo_t *cr,
cairo_stroke (cr);
cairo_translate (cr, 0.5, 0.5);
shadow.shadow = CL_SHADOW_OUT;
shadow.corners = corners;
/*
clearlooks_draw_highlight_and_shade (cr, &shadow,
width,
height, params->radius);*/
}
static void

View File

@ -536,7 +536,6 @@ clearlooks_style_draw_box (DRAW_ARGS)
else if (DETAIL ("button") || DETAIL ("buttondefault"))
{
WidgetParameters params;
ShadowParameters shadow = { CR_CORNER_ALL, CL_SHADOW_NONE } ;
clearlooks_set_widget_parameters (widget, style, state_type, &params);
if (ge_is_in_combo_box(widget))
@ -545,23 +544,21 @@ clearlooks_style_draw_box (DRAW_ARGS)
params.corners = CR_CORNER_TOPRIGHT | CR_CORNER_BOTTOMRIGHT;
else
params.corners = CR_CORNER_TOPLEFT | CR_CORNER_BOTTOMLEFT;
shadow.shadow = CL_SHADOW_IN;
if (params.xthickness > 2)
{
if (params.ltr)
x--;
width++;
}
}
}
else
{
params.corners = CR_CORNER_ALL;
/* if (!(ge_is_combo_box (widget, FALSE))) */
params.enable_glow = TRUE;
}
}
if (GE_IS_TOGGLE_BUTTON (widget) &&
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)))
params.active = TRUE;

View File

@ -313,7 +313,7 @@ BarController::expose (GdkEventExpose* /*event*/)
Gdk::Color c;
Widget* parent;
gint x1=0, x2=0, y1=0, y2=0;
gint x1=0, x2=0, y2=0;
gint w, h;
double fract, radius;
float r, g, b;
@ -327,7 +327,6 @@ BarController::expose (GdkEventExpose* /*event*/)
h = darea.get_height();
x1 = (gint) floor (w * fract);
x2 = x1;
y1 = 0;
y2 = h - 1;
if (use_parent) {

View File

@ -24,12 +24,12 @@
#include <gtkmm2ext/gtkapplication.h>
int
gtk_application_init ()
gtk_application_init (void)
{
return 0;
}
void gtk_application_cleanup ()
void gtk_application_cleanup (void)
{
}
@ -44,6 +44,6 @@ gtk_application_add_app_menu_item (GtkApplicationMenuGroup* group, GtkMenuItem*
}
void
gtk_application_ready ()
gtk_application_ready (void)
{
}

View File

@ -30,9 +30,9 @@ G_BEGIN_DECLS
typedef struct _GtkApplicationMenuGroup GtkApplicationMenuGroup;
int gtk_application_init ();
void gtk_application_ready ();
void gtk_application_cleanup ();
int gtk_application_init (void);
void gtk_application_ready (void);
void gtk_application_cleanup (void);
void gtk_application_set_menu_bar (GtkMenuShell *menu_shell);
GtkApplicationMenuGroup * gtk_application_add_app_menu_group (void);

View File

@ -534,12 +534,8 @@ CairoColor* prolooks_hsl_to_cairo_color (ProlooksHSL* self) {
CairoColor* result = NULL;
gint i = 0;
double* _tmp0_;
gint _hue_shift_size_;
gint hue_shift_length1;
double* hue_shift;
double* _tmp1_;
gint _color_shift_size_;
gint color_shift_length1;
double* color_shift;
double m1 = 0.0;
double m2 = 0.0;
@ -547,8 +543,8 @@ CairoColor* prolooks_hsl_to_cairo_color (ProlooksHSL* self) {
gint _tmp2_ = 0;
CairoColor* color;
g_return_val_if_fail (self != NULL, NULL);
hue_shift = (_tmp0_ = g_new0 (double, 3), hue_shift_length1 = 3, _hue_shift_size_ = hue_shift_length1, _tmp0_);
color_shift = (_tmp1_ = g_new0 (double, 3), color_shift_length1 = 3, _color_shift_size_ = color_shift_length1, _tmp1_);
hue_shift = (_tmp0_ = g_new0 (double, 3), _tmp0_);
color_shift = (_tmp1_ = g_new0 (double, 3), _tmp1_);
if (self->priv->_lightness <= 0.5) {
m2 = self->priv->_lightness * (1 + self->priv->_saturation);
} else {
@ -944,7 +940,6 @@ CairoColor* prolooks_hsv_to_cairo_color (ProlooksHSV* self) {
double r;
double g;
double b;
double v;
gint hi = 0;
double f = 0.0;
double p = 0.0;
@ -955,7 +950,6 @@ CairoColor* prolooks_hsv_to_cairo_color (ProlooksHSV* self) {
r = 0.0;
g = 0.0;
b = 0.0;
v = self->priv->_value;
hi = (gint) prolooks_modula (floor (self->priv->_hue / 60.0), (double) 6);
f = (self->priv->_hue / 60.0) - floor (self->priv->_hue / 60.0);
p = self->priv->_value * (1.0 - self->priv->_saturation);
@ -1330,15 +1324,13 @@ void prolooks_shade_color (const GdkColor* orig, double shade_ratio, GdkColor* r
GdkPixbuf* prolooks_cairo_image_surface_to_pixbuf (cairo_surface_t* surface) {
GdkPixbuf* result = NULL;
guchar* _tmp0_;
gint _knob_data_size_;
gint knob_data_length1;
guchar* knob_data;
g_return_val_if_fail (surface != NULL, NULL);
if (cairo_image_surface_get_format (surface) != CAIRO_FORMAT_ARGB32) {
result = NULL;
return result;
}
knob_data = (_tmp0_ = cairo_image_surface_get_data (surface), knob_data_length1 = -1, _knob_data_size_ = knob_data_length1, _tmp0_);
knob_data = (_tmp0_ = cairo_image_surface_get_data (surface), _tmp0_);
{
gint i;
i = 0;

View File

@ -35,6 +35,6 @@ static inline float fast_log10 (const float val)
return fast_log2(val) / 3.312500f;
}
static inline float minus_infinity() { return -HUGE_VAL; }
static inline float minus_infinity(void) { return -HUGE_VAL; }
#endif /* __pbd_fastlog_h__ */

View File

@ -11,7 +11,7 @@
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#define XML_VERSION "1.0"
xmlChar* xml_version = xmlCharStrdup("1.0");
using namespace std;
@ -151,7 +151,7 @@ XMLTree::write() const
int result;
xmlKeepBlanksDefault(0);
doc = xmlNewDoc((xmlChar*) XML_VERSION);
doc = xmlNewDoc(xml_version);
xmlSetDocCompressMode(doc, _compression);
writenode(doc, _root, doc->children, 1);
result = xmlSaveFormatFileEnc(_filename.c_str(), doc, "UTF-8", 1);
@ -171,7 +171,7 @@ XMLTree::debug(FILE* out) const
XMLNodeList children;
xmlKeepBlanksDefault(0);
doc = xmlNewDoc((xmlChar*) XML_VERSION);
doc = xmlNewDoc(xml_version);
xmlSetDocCompressMode(doc, _compression);
writenode(doc, _root, doc->children, 1);
xmlDebugDumpDocument (out, doc);
@ -188,7 +188,7 @@ XMLTree::write_buffer() const
XMLNodeList children;
xmlKeepBlanksDefault(0);
doc = xmlNewDoc((xmlChar*) XML_VERSION);
doc = xmlNewDoc(xml_version);
xmlSetDocCompressMode(doc, _compression);
writenode(doc, _root, doc->children, 1);
xmlDocDumpMemory(doc, (xmlChar **) & ptr, &len);
@ -358,7 +358,7 @@ XMLTree::find(const string xpath, XMLNode* node) const
xmlDocPtr doc = 0;
if (node) {
doc = xmlNewDoc((xmlChar*) XML_VERSION);
doc = xmlNewDoc(xml_version);
writenode(doc, node, doc->children, 1);
ctxt = xmlXPathNewContext(doc);
} else {
@ -556,7 +556,7 @@ readnode(xmlNodePtr node)
xmlAttrPtr attr;
if (node->name) {
name = (char*)node->name;
name = (const char*)node->name;
}
tmp = new XMLNode(name);
@ -566,7 +566,7 @@ readnode(xmlNodePtr node)
if (attr->children) {
content = (char*)attr->children->content;
}
tmp->add_property((char*)attr->name, content);
tmp->add_property((const char*)attr->name, content);
}
if (node->content) {
@ -592,9 +592,9 @@ writenode(xmlDocPtr doc, XMLNode* n, xmlNodePtr p, int root = 0)
xmlNodePtr node;
if (root) {
node = doc->children = xmlNewDocNode(doc, 0, (xmlChar*) n->name().c_str(), 0);
node = doc->children = xmlNewDocNode(doc, 0, (const xmlChar*) n->name().c_str(), 0);
} else {
node = xmlNewChild(p, 0, (xmlChar*) n->name().c_str(), 0);
node = xmlNewChild(p, 0, (const xmlChar*) n->name().c_str(), 0);
}
if (n->is_content()) {
@ -604,7 +604,7 @@ writenode(xmlDocPtr doc, XMLNode* n, xmlNodePtr p, int root = 0)
props = n->properties();
for (curprop = props.begin(); curprop != props.end(); ++curprop) {
xmlSetProp(node, (xmlChar*) (*curprop)->name().c_str(), (xmlChar*) (*curprop)->value().c_str());
xmlSetProp(node, (const xmlChar*) (*curprop)->name().c_str(), (const xmlChar*) (*curprop)->value().c_str());
}
children = n->children();

View File

@ -33,15 +33,9 @@ class Fader;
class Meter;
class SurfacePort;
struct StripControlDefinition {
const char* name;
uint32_t base_id;
Control* (*factory)(Surface&, int index, const char* name, Group&);
};
struct GlobalControlDefinition {
const char* name;
uint32_t id;
int id;
Control* (*factory)(Surface&, int index, const char* name, Group&);
const char* group_name;
};