Fix some compilation warnings
authorJulien de Kozak <jdekozak@hotmail.com>
Sat, 23 Mar 2013 13:33:20 +0000 (14:33 +0100)
committerJulien de Kozak <jdekozak@hotmail.com>
Sat, 23 Mar 2013 13:50:58 +0000 (14:50 +0100)
gtk2_ardour/startup.cc
gtk2_ardour/utils.cc
libs/ardour/midi_buffer.cc
libs/audiographer/private/gdither/gdither.cc
libs/audiographer/private/gdither/gdither_types.h
libs/audiographer/private/gdither/gdither_types_internal.h
libs/evoral/src/libsmf/smf.c
libs/qm-dsp/maths/MathUtilities.cpp
libs/rubberband/src/main.cpp

index a0ae965f07759651c0e9523b750504b461bb3a55..72c7d5e8b55fdac489b3985d9af29f9b0fa9691a 100644 (file)
@@ -1459,7 +1459,7 @@ ArdourStartup::info_scroller_update()
 
        char buf[512];
        snprintf (buf, std::min(info_scroller_count,sizeof(buf)-1), "%s", ARDOUR_UI::instance()->announce_string().c_str() );
-       buf[info_scroller_count] = NULL;
+       buf[info_scroller_count] = 0;
        info_scroller_label.set_text (buf);
        info_scroller_label.show();
 
index aa68519560534977294548c432fc9735dab9ce18..19f93ad2e82b8005a08790ed341827c0e97ce945 100644 (file)
@@ -676,7 +676,7 @@ set_pango_fontsize ()
 
        /* FT2 rendering - used by GnomeCanvas, sigh */
 
-       pango_ft2_font_map_set_resolution ((PangoFT2FontMap*) pango_ft2_font_map_for_display(), val/1024, val/1024);
+       pango_ft2_font_map_set_resolution ((PangoFT2FontMap*) pango_ft2_font_map_new(), val/1024, val/1024);
 
        /* Cairo rendering, in case there is any */
 
index 403434b6cc0d07a4f11fc757a0dc8ee7763d24c7..b47c3ca1523ff4ee3b8a3f7e4d2ac853adbfe1f8 100644 (file)
@@ -84,7 +84,7 @@ MidiBuffer::read_from (const Buffer& src, framecnt_t nframes, framecnt_t dst_off
        assert (src.type() == DataType::MIDI);
        assert (&src != this);
 
-       const MidiBuffer& msrc = (MidiBuffer&) src;
+       const MidiBuffer& msrc = (const MidiBuffer&) src;
 
        assert (_capacity >= msrc.size());
 
index 966da47b060f98ace73bc230076fa6454d4a8dba..fe9ecc655a5cb203db7c83bd888947c2b2badf69 100644 (file)
@@ -117,7 +117,7 @@ GDither gdither_new(GDitherType type, uint32_t channels,
        s->clamp_u = lrintf(s->scale);
        s->clamp_l = lrintf(-s->scale);
        break;
-    case 23:
+    case GDitherPerformanceTest:
        /* special performance test case */
        s->scale = SCALE_S24;
        s->post_scale = 256;
index bcc0097d7fcd1ddab556cde3bc5ac2db0bf5ecbc..8cc1cdf60d8fc28247abbc874d361932fd10a101 100644 (file)
@@ -36,7 +36,8 @@ typedef enum {
     GDither16bit = 16,
     GDither32bit = 32,
     GDitherFloat = 25,
-    GDitherDouble = 54
+    GDitherDouble = 54,
+    GDitherPerformanceTest = 23
 } GDitherSize;
 
 typedef void *GDither;
index 6cb0c48af9dfdfbccf2f087b5caaa00e1c634a3b..7d8de9d18cd24c7039aec27e289061e0e48021bc 100644 (file)
@@ -42,7 +42,8 @@ typedef enum {
     GDither16bit = 16,
     GDither32bit = 32,
     GDitherFloat = 25,
-    GDitherDouble = 54
+    GDitherDouble = 54,
+    GDitherPerformanceTest = 23
 } GDitherSize;
 
 typedef struct {
index d62dc6d7eb30000a107f5fccf44e9713c3c3c7cf..b79d7543b639d52cf845972bc50ceb977c65b9da 100644 (file)
@@ -377,12 +377,12 @@ smf_event_delete(smf_event_t *event)
 static gint
 events_array_compare_function(gconstpointer aa, gconstpointer bb)
 {
-       smf_event_t *a, *b;
+       const smf_event_t *a, *b;
 
        /* "The comparison function for g_ptr_array_sort() doesn't take the pointers
            from the array as arguments, it takes pointers to the pointers in the array." */
-       a = (smf_event_t *)*(gpointer *)aa;
-       b = (smf_event_t *)*(gpointer *)bb;
+       a = (const smf_event_t *)*(const gpointer *)aa;
+       b = (const smf_event_t *)*(const gpointer *)bb;
 
        if (a->time_pulses < b->time_pulses)
                return (-1);
index 70a275912cec1a63310776b85b481876ddc245a9..9b5b2fc99280e0fbf5c30a7e49d3414d2d6da033 100644 (file)
@@ -265,7 +265,7 @@ void MathUtilities::circShift( double* pData, int length, int shift)
 
 int MathUtilities::compareInt (const void * a, const void * b)
 {
-  return ( *(int*)a - *(int*)b );
+  return ( *(const int*)a - *(const int*)b );
 }
 
 void MathUtilities::normalise(double *data, int length, NormaliseType type)
index 4aef2338c5633a994783a7a995e615d22a3cba64..1c806961800c74afb84ad4538acd48aaeef701c3 100644 (file)
@@ -43,7 +43,7 @@ using RubberBand::usleep;
 
 double tempo_convert(const char *str)
 {
-    const char *d = strchr((char *)str, ':');
+    const char *d = strchr(str, ':');
 
     if (!d || !*d) {
         double m = atof(str);