Clean up some uninitialized values flagged by valgrind.

This commit is contained in:
Jonathan Moore Liles 2008-02-12 19:37:26 -06:00
parent 5ceed377fb
commit 65df570a30
6 changed files with 83 additions and 72 deletions

View File

@ -63,10 +63,11 @@ Canvas::_alloc_array ( void )
Canvas::Canvas ( )
{
m.height = m.width = m.div_w = m.div_h = m.playhead = m.margin_top = m.margin_left = m.playhead = m.w = m.h = m.p1 = m.p2 = 0;
m.origin_x = m.origin_y = m.height = m.width = m.div_w = m.div_h = m.playhead = m.margin_top = m.margin_left = m.playhead = m.w = m.h = m.p1 = m.p2 = 0;
m.margin_top = ruler_height;
m.draw = false;
m.ruler_drawn = false;
m.mapping_drawn = false;
m.grid_drawn = false;
@ -269,7 +270,7 @@ Canvas::copy ( void )
void
Canvas::_reset ( void )
{
cell_t empty;
cell_t empty = {0,0,0,0};
for ( uint y = m.vp->h; y-- ; )
for ( uint x = m.vp->w; x-- ; )

1
grid.C
View File

@ -51,6 +51,7 @@ Grid::Grid ( void )
viewport.x = 0;
viewport.y = 0;
_playing = false;
_start = _end = _index = 0;
}

View File

@ -48,7 +48,11 @@ _grid->events( _old );
delete _old;
delete window;} open
_el = _old = NULL;
o->hide();
Fl::delete_widget( o );} open selected
xywh {704 82 659 803} type Double box DOWN_BOX resizable
code0 {\#include "event_edit.H"}
code1 {\#include "../grid.H"}
@ -244,8 +248,7 @@ else
{
scroll_bar->hide();
scroll_w->size( scroll_w->parent()->w(), scroll_w->parent()->h() );
}} {selected
}
}} {}
}
Function {scroll( int y )} {open return_type void
} {
@ -291,6 +294,7 @@ while( w->shown() )
widget_class Event_Widget {user_data_type {void *} open
xywh {969 357 594 31} type Single
code0 {\#include "../event.H"}
code1 {_event = NULL;}
class Fl_Group size_range {400 24 0 24} visible
} {
decl {static const Fl_Color note_color = FL_BLACK;} {}
@ -326,6 +330,8 @@ for ( int i = 2; i < children(); i++ )
Fl_Valuator *d1, *d2;
d1 = d2 = NULL;
name->color( FL_BLACK );
name->value( e->selected() );

130
gui/ui.fl
View File

@ -1388,8 +1388,7 @@ if ( _c )
}
// Fl_Window::resize( x, y, w, h );} {selected
}
// Fl_Window::resize( x, y, w, h );} {}
}
Function {draw()} {open return_type void
} {
@ -1505,6 +1504,66 @@ _border_drawn = true;} {}
}
}
class Instrument_Editor {} {
Function {Instrument_Editor()} {open return_type void
} {
code {make_window();} {}
}
decl {Instrument *_inst;} {}
decl {int _note;} {}
Function {make_window()} {open
} {
Fl_Window window {
label {Instrument Editor}
callback {done->do_callback();} open
xywh {670 458 339 191} type Double visible
} {
Fl_Box {} {
label {Instrument Row}
xywh {8 15 321 28} box ROUNDED_BOX color 94 labelsize 22 labelcolor 39
}
Fl_Input name_field {
label Name
callback {_inst->note_name( _note, strdup( o->value() ) );}
xywh {10 70 321 25} selection_color 48 align 1 when 1 textcolor 32
}
Fl_Value_Slider volume_slider {
label {Volume %}
callback {_inst->velocity( _note, o->value() );}
xywh {10 112 321 27} type Horizontal align 1 maximum 100 step 1 textsize 14
}
Fl_Value_Output note_field {
label {Note:}
xywh {52 158 43 24}
}
Fl_Return_Button done {
label Done
callback {if ( _inst )
_inst->save();
window->hide();}
xywh {255 157 76 25}
}
}
}
Function {set( Instrument *i, int n )} {open return_type void
} {
code {_inst = i;
_note = n;
volume_slider->value( i->velocity( n ) );
name_field->value( i->note_name( n ) );
note_field->value( n );} {}
}
Function {run()} {open return_type void
} {
code {window->show();
while ( window->shown() )
Fl::wait();} {}
}
}
class Trigger {: {public Fl_Dial}
} {
Function {Trigger( int X, int Y, int W, int H, const char *L = 0 ) : Fl_Dial( X, Y, W, H, L )} {open
@ -1574,67 +1633,7 @@ return r;} {}
}
}
class Instrument_Editor {} {
Function {Instrument_Editor()} {open return_type void
} {
code {make_window();} {}
}
decl {Instrument *_inst;} {}
decl {int _note;} {}
Function {make_window()} {open
} {
Fl_Window window {
label {Instrument Editor}
callback {done->do_callback();} open
xywh {670 458 339 191} type Double visible
} {
Fl_Box {} {
label {Instrument Row}
xywh {8 15 321 28} box ROUNDED_BOX color 94 labelsize 22 labelcolor 39
}
Fl_Input name_field {
label Name
callback {_inst->note_name( _note, strdup( o->value() ) );}
xywh {10 70 321 25} selection_color 48 align 1 when 1 textcolor 32
}
Fl_Value_Slider volume_slider {
label {Volume %}
callback {_inst->velocity( _note, o->value() );}
xywh {10 112 321 27} type Horizontal align 1 maximum 100 step 1 textsize 14
}
Fl_Value_Output note_field {
label {Note:}
xywh {52 158 43 24}
}
Fl_Return_Button done {
label Done
callback {if ( _inst )
_inst->save();
window->hide();}
xywh {255 157 76 25}
}
}
}
Function {set( Instrument *i, int n )} {open return_type void
} {
code {_inst = i;
_note = n;
volume_slider->value( i->velocity( n ) );
name_field->value( i->note_name( n ) );
note_field->value( n );} {}
}
Function {run()} {open return_type void
} {
code {window->show();
while ( window->shown() )
Fl::wait();} {}
}
}
widget_class Triggers {
widget_class Triggers {open
xywh {121 31 1278 1003} type Double hide resizable
code0 {populate();}
code1 {\#include <Fl/Fl_Dial.H>}
@ -1717,7 +1716,7 @@ for ( i = 0; i < MAX_PATTERN; i++ )
{
b->color( fl_lighter( FL_GRAY ) );
Fl_Color c;
Fl_Color c = FL_BLUE;
switch ( p->mode() )
{
@ -1741,7 +1740,8 @@ for ( i = 0; i < MAX_PATTERN; i++ )
b->value( 0 );
}
}} {}
}} {selected
}
}
Function {resize( int X, int Y, int W, int H )} {open return_type void
} {

View File

@ -291,7 +291,7 @@ Instrument::listing ( void )
delete sys;
char **sa = (char**)malloc( usr->size() * sizeof( char * ) + 1 );
char **sa = (char**)malloc( (usr->size() + 1) * sizeof( char * ) );
int i = 0;
for ( list <string>::iterator s = usr->begin(); s != usr->end(); s++, i++ )

View File

@ -31,7 +31,10 @@
sequence::sequence ( void )
{
_rd = new data;
_notes = NULL;
_name = _notes = NULL;
_index = 0;
_playing = 0;
}