Fixes for GCC 4.3.

git-svn-id: svn://localhost/ardour2/branches/3.0@3303 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
David Robillard 2008-05-02 18:35:05 +00:00
parent 38eb5f4539
commit da45f489dd
40 changed files with 61 additions and 31 deletions

View file

@ -17,6 +17,7 @@
*/
#include <cstring>
#include <vector>
#include <string>
#include <list>

View file

@ -74,12 +74,13 @@ AutomationController::create(boost::shared_ptr<Automatable> parent, boost::share
void
AutomationController::update_label(char* label, int label_len)
{
if (label && label_len)
if (label && label_len) {
// Hack to display CC rounded to int
if (_controllable->parameter().type() == MidiCCAutomation)
snprintf(label, label_len, "%d", (int)_controllable->get_value());
else
snprintf(label, label_len, "%.3f", _controllable->get_value());
}
}
void

View file

@ -18,6 +18,7 @@
*/
#include <string>
#include <cstring>
#include "editing.h"

View file

@ -3733,7 +3733,7 @@ Editor::get_valid_views (TimeAxisView* track, RouteGroup* group)
v->push_back (*i);
}
} else if (track != 0 && group == 0 || (track != 0 && group != 0 && !group->is_active())) {
} else if ((track != 0 && group == 0) || (track != 0 && group != 0 && !group->is_active())) {
/* just the view for this track
*/

View file

@ -518,7 +518,7 @@ Editor::button_selection (ArdourCanvas::Item* item, GdkEvent* event, ItemType it
(mouse_mode != MouseTimeFX || item_type != RegionItem) &&
(mouse_mode != MouseRange)) ||
(event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_RELEASE || event->button.button > 3)) {
((event->type != GDK_BUTTON_PRESS && event->type != GDK_BUTTON_RELEASE) || event->button.button > 3)) {
return;
}

View file

@ -21,6 +21,7 @@
#include <fft_result.h>
#include <fft_graph.h>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>

View file

@ -289,11 +289,12 @@ MidiRegionView::canvas_event(GdkEvent* ev)
if (_mouse_state == AddDragging)
event_x = trackview.editor.frame_to_pixel(event_frame);
if (drag_rect)
if (drag_rect) {
if (event_x > drag_start_x)
drag_rect->property_x2() = event_x;
else
drag_rect->property_x1() = event_x;
}
if (drag_rect && _mouse_state == SelectRectDragging) {
if (event_y > drag_start_y)

View file

@ -738,7 +738,7 @@ NewSessionDialog::which_page () const
} else if (page_set == EnginePage) {
return EnginePage;
} else if (page_set == NewPage|OpenPage) {
} else if (page_set == (NewPage|OpenPage)) {
switch (num) {
case 0:
return NewPage;
@ -746,7 +746,7 @@ NewSessionDialog::which_page () const
return OpenPage;
}
} else if (page_set == NewPage|EnginePage) {
} else if (page_set == (NewPage|EnginePage)) {
switch (num) {
case 0:
return NewPage;
@ -754,7 +754,7 @@ NewSessionDialog::which_page () const
return EnginePage;
}
} else if (page_set == NewPage|EnginePage|OpenPage) {
} else if (page_set == (NewPage|EnginePage|OpenPage)) {
switch (num) {
case 0:
return NewPage;
@ -764,7 +764,7 @@ NewSessionDialog::which_page () const
return EnginePage;
}
} else if (page_set == OpenPage|EnginePage) {
} else if (page_set == (OpenPage|EnginePage)) {
switch (num) {
case 0:
return OpenPage;
@ -772,6 +772,8 @@ NewSessionDialog::which_page () const
return EnginePage;
}
}
return NewPage; /* shouldn't get here */
}
void

View file

@ -1229,7 +1229,7 @@ RouteTimeAxisView::get_selectables (nframes_t start, nframes_t end, double top,
nframes_t start_adjusted = session_frame_to_track_frame(start, speed);
nframes_t end_adjusted = session_frame_to_track_frame(end, speed);
if (_view && ((top < 0.0 && bot < 0.0)) || touched (top, bot)) {
if ((_view && ((top < 0.0 && bot < 0.0))) || touched (top, bot)) {
_view->get_selectables (start_adjusted, end_adjusted, results);
}

View file

@ -399,11 +399,11 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
found_list (ListStore::create(found_list_columns)),
freesound_list (ListStore::create(freesound_list_columns)),
chooser (FILE_CHOOSER_ACTION_OPEN),
found_list_view (found_list),
freesound_list_view (freesound_list),
preview (persistent),
found_search_btn (_("Search")),
freesound_search_btn (_("Start Downloading"))
found_list_view (found_list),
freesound_search_btn (_("Start Downloading")),
freesound_list_view (freesound_list)
{
resetting_ourselves = false;

View file

@ -16,10 +16,10 @@
675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <ardour/amp.h>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <ardour/amp.h>
#include <ardour/buffer_set.h>
#include <ardour/audio_buffer.h>

View file

@ -19,6 +19,7 @@
#ifndef __ardour_audio_buffer_h__
#define __ardour_audio_buffer_h__
#include <cstring>
#include <ardour/buffer.h>
namespace ARDOUR {

View file

@ -20,6 +20,7 @@
#ifndef __ardour_silentfilesource_h__
#define __ardour_silentfilesource_h__
#include <cstring>
#include <ardour/audiofilesource.h>
namespace ARDOUR {

View file

@ -398,8 +398,8 @@ AudioDiskstream::check_record_status (nframes_t transport_frame, nframes_t nfram
/* if per-track or global rec-enable turned on while the other was already on, we've started recording */
if ((change & track_rec_enabled) && record_enabled() && (!(change & global_rec_enabled) && can_record) ||
((change & global_rec_enabled) && can_record && (!(change & track_rec_enabled) && record_enabled()))) {
if (((change & track_rec_enabled) && record_enabled() && (!(change & global_rec_enabled) && can_record)) ||
(((change & global_rec_enabled) && can_record && (!(change & track_rec_enabled) && record_enabled())))) {
/* starting to record: compute first+last frames */

View file

@ -1,3 +1,4 @@
#include <cstring>
#include <vamp-sdk/hostext/PluginLoader.h>
#include <glibmm/miscutils.h>
#include <glibmm/fileutils.h>

View file

@ -1210,7 +1210,7 @@ AutomationList::rt_safe_earliest_event_linear_unlocked (double start, double end
x = first->when + (y - first->value) / (double)slope;
while ((inclusive && x < start) || x <= start && y != next->value) {
while ((inclusive && x < start) || (x <= start && y != next->value)) {
if (first->value < next->value) // ramping up
y += 1.0;

View file

@ -1,6 +1,7 @@
#include <unistd.h>
#include <sys/stat.h>
#include <cstring>
#include <climits>
#include <cerrno>

View file

@ -387,7 +387,7 @@ void gdither_runf(GDither s, uint32_t channel, uint32_t length,
}
/* some common case handling code - looks a bit wierd, but it allows
* the compiler to optiomise out the branches in the inner loop */
* the compiler to optimise out the branches in the inner loop */
if (s->bit_depth == 8 && s->dither_depth == 8) {
switch (s->type) {
case GDitherNone:
@ -411,7 +411,7 @@ void gdither_runf(GDither s, uint32_t channel, uint32_t length,
ss, x, y, MAX_U8, MIN_U8);
break;
}
} else if (s->bit_depth == s->dither_depth == 16) {
} else if (s->bit_depth == 16 && s->dither_depth == 16) {
switch (s->type) {
case GDitherNone:
gdither_innner_loop(GDitherNone, s->channels, 0.0f, SCALE_S16,

View file

@ -339,7 +339,7 @@ MidiDiskstream::check_record_status (nframes_t transport_frame, nframes_t nframe
/* if per-track or global rec-enable turned on while the other was already on, we've started recording */
if ((change & track_rec_enabled) && record_enabled() && (!(change & global_rec_enabled) && can_record) ||
if (((change & track_rec_enabled) && record_enabled() && (!(change & global_rec_enabled) && can_record)) ||
((change & global_rec_enabled) && can_record && (!(change & track_rec_enabled) && record_enabled()))) {
/* starting to record: compute first+last frames */
@ -909,7 +909,7 @@ MidiDiskstream::do_flush (Session::RunContext context, bool force_flush)
total = _session.transport_frame() - _last_flush_frame;
if (total == 0 || _capture_buf->read_space() == 0 && _session.transport_speed() == 0 || (total < disk_io_chunk_frames && !force_flush && was_recording)) {
if (total == 0 || (_capture_buf->read_space() == 0 && _session.transport_speed() == 0) || (total < disk_io_chunk_frames && !force_flush && was_recording)) {
goto out;
}

View file

@ -17,6 +17,7 @@
*/
#include <cstring>
#include <cerrno>
#include <unistd.h>
#include <fstream>

View file

@ -134,8 +134,8 @@ Session::Session (AudioEngine &eng,
_session_dir (new SessionDirectory(fullpath)),
pending_events (2048),
post_transport_work((PostTransportWork)0),
midi_requests (128),
_send_smpte_update (false),
midi_requests (128),
diskstreams (new DiskstreamList),
routes (new RouteList),
auditioner ((Auditioner*) 0),
@ -204,8 +204,8 @@ Session::Session (AudioEngine &eng,
_session_dir ( new SessionDirectory(fullpath)),
pending_events (2048),
post_transport_work((PostTransportWork)0),
midi_requests (16),
_send_smpte_update (false),
midi_requests (16),
diskstreams (new DiskstreamList),
routes (new RouteList),
_bundle_xml_node (0),

View file

@ -17,6 +17,7 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <cstring>
#include <cstdio>
#include <cassert>
#include <iostream>

View file

@ -17,6 +17,7 @@
*/
#include <cstring>
#include <cerrno>
#include <climits>

View file

@ -21,6 +21,7 @@
#include <stdint.h>
#include <cstdio> /* for sprintf */
#include <cstring>
#include <cmath>
#include <cctype>
#include <string>

View file

@ -860,7 +860,7 @@ clearlooks_style_draw_box (DRAW_ARGS)
}
else if (DETAIL ("hseparator") || DETAIL ("vseparator"))
{
gchar *new_detail = detail;
const gchar *new_detail = detail;
/* Draw a normal separator, we just use this because it gives more control
* over sizing (currently). */

View file

@ -149,7 +149,7 @@ BarController::button_release (GdkEventButton* ev)
} else {
double scale;
if (ev->state & (GDK_CONTROL_MASK|GDK_SHIFT_MASK) == (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) {
if ((ev->state & (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) == (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) {
scale = 0.01;
} else if (ev->state & GDK_CONTROL_MASK) {
scale = 0.1;
@ -179,7 +179,7 @@ BarController::scroll (GdkEventScroll* ev)
{
double scale;
if (ev->state & (GDK_CONTROL_MASK|GDK_SHIFT_MASK) == (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) {
if ((ev->state & (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) == (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) {
scale = 0.01;
} else if (ev->state & GDK_CONTROL_MASK) {
scale = 0.1;
@ -215,7 +215,7 @@ BarController::motion (GdkEventMotion* ev)
return TRUE;
}
if (ev->state & (GDK_CONTROL_MASK|GDK_SHIFT_MASK) == (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) {
if ((ev->state & (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) == (GDK_CONTROL_MASK|GDK_SHIFT_MASK)) {
scale = 0.01;
} else if (ev->state & GDK_CONTROL_MASK) {
scale = 0.1;

View file

@ -20,6 +20,7 @@
#include <fcntl.h>
#include <cerrno>
#include <cstring>
#include <pbd/error.h>
#include <pbd/pathscanner.h>
@ -65,7 +66,7 @@ FD_MidiPort::FD_MidiPort (const XMLNode& node,
midi_filename_pattern = new string (pattern);
}
if (desc.mode & O_NONBLOCK == 0) {
if ((desc.mode & O_NONBLOCK) == 0) {
/* we unconditionally set O_NONBLOCK during
open, but the request didn't ask for it,
so remove it.

View file

@ -18,6 +18,7 @@
$Id$
*/
#include <cstring>
#include <string>
#include <cstdlib>
#include <midi++/types.h>

View file

@ -18,6 +18,7 @@
$Id$
*/
#include <cstring>
#include <midi++/types.h>
#include <midi++/port.h>
#include <midi++/channel.h>

View file

@ -21,6 +21,7 @@
$Id$
*/
#include <cstring>
#include <cstdlib>
#include <unistd.h>
#include <string>

View file

@ -18,6 +18,7 @@
$Id$
*/
#include <cstring>
#include <cstdlib>
#include <unistd.h>
#include <string>

View file

@ -17,6 +17,7 @@
*/
#include <cstring>
#include <stdint.h>
#include <unistd.h>
#include <fcntl.h>

View file

@ -19,6 +19,7 @@
#include <cmath>
#include <stdint.h>
#include <stdlib.h>
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
#endif
@ -101,13 +102,13 @@ short_version (string orig, string::size_type target_length)
int
atoi (const string& s)
{
return std::atoi (s.c_str());
return ::atoi (s.c_str());
}
double
atof (const string& s)
{
return std::atof (s.c_str());
return ::atof (s.c_str());
}
vector<string>

View file

@ -19,6 +19,7 @@
*/
#include <cstdio>
#include <cstring>
#include <string>
#include <limits.h>

View file

@ -18,6 +18,7 @@
$Id$
*/
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <vector>

View file

@ -20,6 +20,7 @@
#ifndef ringbuffer_h
#define ringbuffer_h
#include <cstring>
#include <glib.h>
template<class T>

View file

@ -18,6 +18,7 @@
$Id$
*/
#include <cstdlib>
#include <iostream>
#include <vector>

View file

@ -34,6 +34,8 @@
authorization.
*/
#include <cstring>
#include <cstdlib>
#include "PluginAdapter.h"
//#define DEBUG_PLUGIN_ADAPTER 1

View file

@ -34,6 +34,7 @@
authorization.
*/
#include <stdlib.h>
#include "PluginHostAdapter.h"
namespace Vamp

View file

@ -42,6 +42,7 @@
#include <fstream>
#include <cctype> // tolower
#include <cstring>
#ifdef _WIN32