reduce compile warnings (fix bad indents, buffer sizes, etc)

This commit is contained in:
c0ntrol
2018-08-11 16:48:40 +02:00
parent 1dc2a72e19
commit f4f77cfeea
9 changed files with 13246 additions and 13231 deletions

View File

@@ -276,6 +276,8 @@ lav_file_t *lav_open_output_file(char *filename, char format,
else
quicktime_set_video(lav_fd->qt_fd,1, width,height,fps,
QUICKTIME_DV );
if (asize)
quicktime_set_audio(lav_fd->qt_fd, achans, arate, asize, QUICKTIME_TWOS);
@@ -458,6 +460,7 @@ int lav_write_audio(lav_file_t *lav_file, uint8_t *buff, long samps)
for (i = 0; i < channels; i++)
free(qt_audion[i]);
free(qt_audion);
}
else

View File

@@ -1626,6 +1626,7 @@ int sample_set_chain_source(int s1, int position, int input)
sample = sample_get(s1);
if (!sample)
return -1;
if (position < 0 || position >= SAMPLE_MAX_EFFECTS)
return -1;
@@ -1638,6 +1639,7 @@ int sample_set_chain_source(int s1, int position, int input)
if(second && second->edit_list)
vj_el_clear_cache( second->edit_list );
}
if( sample->effect_chain[position]->source_type == 0 &&
sample->effect_chain[position]->effect_id > 0 &&
sample->effect_chain[position]->channel > 0 &&
@@ -2531,9 +2533,12 @@ editlist *sample_get_editlist(int s1)
int sample_cached(sample_info *s, int b_sample )
{
int i = 0;
for( i = 0; i < SAMPLE_MAX_EFFECTS ;i++ )
if( s->effect_chain[i]->source_type == 0 && s->effect_chain[i]->channel == b_sample)
for( i = 0; i < SAMPLE_MAX_EFFECTS ;i++ ) {
if( s->effect_chain[i]->source_type == 0 && s->effect_chain[i]->channel == b_sample) {
return 1;
}
}
return 0;
}

View File

@@ -898,8 +898,14 @@ vevo_property_element_size(vevo_port_t * p, const char *key, const int idx )
\param port_type Type of Port to Create. Port types <= 1024 are typed, > 1024 are anonymous ports.
\return A New Port
*/
#ifdef STRICT_CHECKING
vevo_port_t *vevo_port_new(int port_type, const char *func, const int line_no)
{
veejay_msg(VEEJAY_MSG_DEBUG,"New port %d called from %s:%d", port_type, func, line_no);
#else
vevo_port_t *vevo_port_new(int port_type)
{
#endif
__vevo_port_t *port = (__vevo_port_t *) vj_malloc(sizeof(__vevo_port_t));
port->index = NULL;
@@ -998,8 +1004,14 @@ int vevo_port_verify( vevo_port_t *port )
/*!
\param p Port to destroy
*/
#ifdef STRICT_CHECKING
void vevo_port_free( vevo_port_t *port, const char *func, const int line_no)
{
veejay_msg(VEEJAY_MSG_DEBUG, "Free port called from %s:%d", func, line_no);
#else
void vevo_port_free( vevo_port_t *port )
{
#endif
if(port != NULL) {
vevo_port_free_(port );
port = NULL;
@@ -1506,7 +1518,7 @@ void *vevo_port_register( vevo_port_t *in, vevo_port_t *ref )
void *port = in;
const void *store = ref;
if(!port)
port = vevo_port_new( VEVO_PORT_POOL );
port = vpn( VEVO_PORT_POOL );
char pkey[32];
if(store)
{

View File

@@ -89,6 +89,7 @@ void perspective_free() {
free(perspective_private_[i] );
perspective_private_[i] = NULL;
}
if( perspective_vp_ )
viewport_destroy( perspective_vp_ );
perspective_vp_ = NULL;

View File

@@ -130,24 +130,19 @@ void rotozoom_destroy()
{
int j;
for (j = 0; j < 9; j++) {
if( test_roto[j] )
free(test_roto[j]);
if( test_roto2[j]);
free(test_roto2[j]);
}
}
int rotozoom_malloc(int width, int height)
{
rotobuffer[0] = (uint8_t *) vj_calloc(sizeof(uint8_t) * width * height * 3);
if(!rotobuffer[0])
return 0;
rotobuffer[1] = rotobuffer[0] + (width * height);
rotobuffer[2] = rotobuffer[1] + (width * height);
return 1;
}
void rotozoom_free() {

View File

@@ -60,12 +60,8 @@ void veejay_set_sample(veejay_t *info, int sample);
int veejay_set_frame(veejay_t *info, long frame_num);
#ifdef STRICT_CHECKING
#define veejay_change_state(a,b) vcs(a,b,__FUNCTION__,__LINE__)
void vcs(veejay_t *info, int new_state,const char *caller_func,const int caller_line);
#else
void veejay_change_state(veejay_t *info, int new_state);
#endif
int veejay_set_speed(veejay_t *info , int speed);
int veejay_hold_frame(veejay_t *info, int rrp, int pos);

View File

@@ -448,11 +448,13 @@ while(*c) { \
if(__z > _last_known_num_args ) break; \
switch(*c++) {\
case 's':\
if( b != NULL ) {\
__tmpstr = (char*)va_arg(d,char*);\
if(__tmpstr != NULL) {\
sprintf( b,"%s",__tmpstr);\
}\
__z++ ;\
}\
break;\
case 'd': a[__z] = *( va_arg(d, int*)); __z++ ;\
break; }\
@@ -8233,8 +8235,8 @@ void vj_event_send_sample_info ( void *ptr, const char format[], va_list ap )
}
if(failed) {
s_print_buf = get_print_buf( 8 );
snprintf( s_print_buf,8, "%08d", 0 );
s_print_buf = get_print_buf( 9 );
snprintf( s_print_buf,9, "%08d", 0 );
}
SEND_MSG(v , s_print_buf );
free(s_print_buf);
@@ -8346,8 +8348,8 @@ void vj_event_get_image_part ( void *ptr, const char format[], va_list ap )
}
}
char header[8];
sprintf( header, "%08d",len );
char header[9];
snprintf( header, sizeof(header), "%08d",len );
SEND_DATA(v, header, 8 );
SEND_DATA(v, start_addr, len );
free(start_addr);
@@ -9506,7 +9508,7 @@ void vj_event_send_sample_options ( void *ptr, const char format[], va_list ap )
P_A(args,str,format,ap);
char options[100];
char options[256];
char prefix[4];
char *s_print_buf = get_print_buf(128);

View File

@@ -286,7 +286,9 @@ static void osc_add_client(void *context, int arglen, const void *vargs, OSCTime
int args[16];
int __a = vj_osc_count_int_arguments(arglen,vargs);
int __n = vj_osc_parse_char_arguments(arglen,vargs,str);
memset( args,0,16 );
memset( args,0,sizeof(args) );
str[__n] = '\0';
vj_osc_parse_int_arguments( arglen , vargs , args );
@@ -451,8 +453,6 @@ static void osc_iterate_clients()
int res = osc_client_status_send( clnt, cmd );
if( res == 0 ) {
( port );
osc_clients[i] = NULL;
veejay_msg(VEEJAY_MSG_WARNING,"Failed to send %s",cmd);
}
free(cmd);
@@ -468,7 +468,8 @@ static void osc_vims_method(void *context, int arglen, const void *vargs, OSCTi
int args[16];
int __a = vj_osc_count_int_arguments(arglen,vargs);
int __n = vj_osc_parse_char_arguments(arglen,vargs,str);
memset( args,0,16 );
memset( args,0,sizeof(args) );
str[__n] = '\0';
vj_osc_parse_int_arguments( arglen , vargs , args );