From e13e0a987ad66b8274fcbaddc71eac583ea80bea Mon Sep 17 00:00:00 2001 From: Good Guy Date: Mon, 20 Jun 2016 10:30:02 -0600 Subject: [PATCH] compiler issues, warnings, makefile spiffs --- cinelerra-5.1/PKGBUILD | 4 +- cinelerra-5.1/cinelerra/Makefile | 2 +- cinelerra-5.1/cinelerra/attachmentpoint.C | 16 +++---- cinelerra-5.1/cinelerra/garbage.C | 2 +- cinelerra-5.1/cinelerra/libmjpeg.C | 13 +++--- cinelerra-5.1/cinelerra/tracks.C | 11 ++--- cinelerra-5.1/cinelerra/vattachmentpoint.C | 6 +-- cinelerra-5.1/cinelerra/virtualanode.C | 45 +++++++++--------- cinelerra-5.1/cinelerra/virtualnode.C | 36 +++++++-------- cinelerra-5.1/guicast/Makefile | 2 +- cinelerra-5.1/libzmpeg3/audio/layer2.C | 9 ++-- cinelerra-5.1/libzmpeg3/libzmpeg3.h | 4 +- cinelerra-5.1/plugin_config | 4 +- cinelerra-5.1/plugins/C41/c41.C | 6 ++- cinelerra-5.1/plugins/chromakeyhsv/Makefile | 4 +- .../plugins/freeverb/Components/denormals.h | 46 +++++++++++-------- 16 files changed, 106 insertions(+), 104 deletions(-) diff --git a/cinelerra-5.1/PKGBUILD b/cinelerra-5.1/PKGBUILD index 5f01f86c..adaa8047 100644 --- a/cinelerra-5.1/PKGBUILD +++ b/cinelerra-5.1/PKGBUILD @@ -24,8 +24,8 @@ build() { ./autogen.sh ./configure --prefix=/usr --with-exec-name=$pkgname CFG_VARS="\ -CFLAGS='-Wno-narrowing -O2 -ggdb -fno-omit-frame-pointer' \ -CXXFLAGS='-Wno-narrowing -O2 -ggdb -fno-omit-frame-pointer' \ +CFLAGS='-Wno-narrowing -O2 -g -fno-omit-frame-pointer' \ +CXXFLAGS='-Wno-narrowing -O2 -g -fno-omit-frame-pointer' \ WERROR_CFLAGS='-fpermissive'" \ make 2>&1 | tee log } diff --git a/cinelerra-5.1/cinelerra/Makefile b/cinelerra-5.1/cinelerra/Makefile index 8abbcdc3..51820d70 100644 --- a/cinelerra-5.1/cinelerra/Makefile +++ b/cinelerra-5.1/cinelerra/Makefile @@ -441,7 +441,7 @@ $(OBJDIR)/sha1.o: sha1.C sha1.h $(CXX) `cat $(OBJDIR)/c_flags` -O3 -c $< -o $@ $(DCRAW): dcraw.c - $(GCC) `cat $(OBJDIR)/c_flags` dcraw.c -c -o $*.o + $(GCC) `cat $(OBJDIR)/c_flags` -Wno-misleading-indentation dcraw.c -c -o $*.o $(THEME_DATA): cd $(OBJDIR) && \ diff --git a/cinelerra-5.1/cinelerra/attachmentpoint.C b/cinelerra-5.1/cinelerra/attachmentpoint.C index 65341f54..1d294613 100644 --- a/cinelerra-5.1/cinelerra/attachmentpoint.C +++ b/cinelerra-5.1/cinelerra/attachmentpoint.C @@ -62,7 +62,7 @@ int AttachmentPoint::reset_parameters() void AttachmentPoint::reset_status() { - if(!this) printf("AttachmentPoint::reset_status NULL\n"); + if(!(void *)this) printf("AttachmentPoint::reset_status NULL\n"); start_position = 0; len = 0; sample_rate = 0; @@ -79,7 +79,7 @@ int AttachmentPoint::identical(AttachmentPoint *old) int AttachmentPoint::render_init() { - if(!this) printf("AttachmentPoint::render_init NULL\n"); + if(!(void *)this) printf("AttachmentPoint::render_init NULL\n"); if(plugin_server && plugin->on) { // Start new plugin servers if the number of nodes changed. @@ -155,7 +155,7 @@ void AttachmentPoint::render_stop() int AttachmentPoint::attach_virtual_plugin(VirtualNode *virtual_plugin) { - if(!this) printf("AttachmentPoint::attach_virtual_plugin NULL\n"); + if(!(void *)this) printf("AttachmentPoint::attach_virtual_plugin NULL\n"); int buffer_number = 0; if(plugin_server && plugin->on) @@ -183,7 +183,7 @@ int AttachmentPoint::attach_virtual_plugin(VirtualNode *virtual_plugin) int AttachmentPoint::multichannel_shared(int search_new) { - if(!this) printf("AttachmentPoint::multichannel_shared NULL\n"); + if(!(void *)this) printf("AttachmentPoint::multichannel_shared NULL\n"); if(search_new) { if(new_virtual_plugins.total && @@ -201,7 +201,7 @@ int AttachmentPoint::multichannel_shared(int search_new) int AttachmentPoint::singlechannel() { - if(!this) printf("AttachmentPoint::singlechannel NULL\n"); + if(!(void *)this) printf("AttachmentPoint::singlechannel NULL\n"); if(plugin_server && !plugin_server->multichannel) return 1; return 0; } @@ -210,7 +210,7 @@ int AttachmentPoint::singlechannel() void AttachmentPoint::render_gui(void *data, PluginServer *server) { //printf("AttachmentPoint::render_gui 1 %p %p\n", server, plugin_servers.get(0)); - if(!this) printf("AttachmentPoint::render_gui 1 NULL\n"); + if(!(void *)this) printf("AttachmentPoint::render_gui 1 NULL\n"); // Discard if not 1st plugin server, so single channel plugins don't get double GUI updates if(server != plugin_servers.get(0)) return; @@ -221,7 +221,7 @@ void AttachmentPoint::render_gui(void *data, PluginServer *server) void AttachmentPoint::render_gui(void *data, int size, PluginServer *server) { - if(!this) printf("AttachmentPoint::render_gui 2 NULL\n"); + if(!(void *)this) printf("AttachmentPoint::render_gui 2 NULL\n"); // Discard if not 1st plugin server, so single channel plugins don't get double GUI updates if(server != plugin_servers.get(0)) return; @@ -239,7 +239,7 @@ int AttachmentPoint::gui_open() int AttachmentPoint::dump(FILE *fp) { - if(this) + if((void *)this) { fprintf(fp," Attachmentpoint this=%p virtual_plugins=%d\n", this, new_virtual_plugins.total); if(plugin_server) plugin_server->dump(fp); diff --git a/cinelerra-5.1/cinelerra/garbage.C b/cinelerra-5.1/cinelerra/garbage.C index 65447359..8b15d8b6 100644 --- a/cinelerra-5.1/cinelerra/garbage.C +++ b/cinelerra-5.1/cinelerra/garbage.C @@ -58,7 +58,7 @@ void Garbage::add_user() int Garbage::remove_user() { - if(!this) return 0; + if(!(void *)this) return 0; //printf("Garbage::remove_user %d lock=%p users=%d\n", __LINE__, lock, users); if(users <= 0) { diff --git a/cinelerra-5.1/cinelerra/libmjpeg.C b/cinelerra-5.1/cinelerra/libmjpeg.C index 14937dfb..7cf2159c 100644 --- a/cinelerra-5.1/cinelerra/libmjpeg.C +++ b/cinelerra-5.1/cinelerra/libmjpeg.C @@ -771,13 +771,12 @@ printf("decompress_field %d\n", __LINE__); jpeg_start_decompress(&engine->jpeg_decompress); // Generate colormodel from jpeg sampling - if(engine->jpeg_decompress.comp_info[0].v_samp_factor == 2 && - engine->jpeg_decompress.comp_info[0].h_samp_factor == 2) - mjpeg->jpeg_color_model = BC_YUV420P; - else - if(engine->jpeg_decompress.comp_info[0].v_samp_factor == 1 && - engine->jpeg_decompress.comp_info[0].h_samp_factor == 2) - mjpeg->jpeg_color_model = BC_YUV422P; + if( engine->jpeg_decompress.comp_info[0].v_samp_factor == 2 && + engine->jpeg_decompress.comp_info[0].h_samp_factor == 2) + mjpeg->jpeg_color_model = BC_YUV420P; + else if(engine->jpeg_decompress.comp_info[0].v_samp_factor == 1 && + engine->jpeg_decompress.comp_info[0].h_samp_factor == 2) + mjpeg->jpeg_color_model = BC_YUV422P; else mjpeg->jpeg_color_model = BC_YUV444P; diff --git a/cinelerra-5.1/cinelerra/tracks.C b/cinelerra-5.1/cinelerra/tracks.C index 9d994f47..e2abde91 100644 --- a/cinelerra-5.1/cinelerra/tracks.C +++ b/cinelerra-5.1/cinelerra/tracks.C @@ -402,23 +402,20 @@ int Tracks::detach_shared_effects(int module) int Tracks::total_of(int type) { int result = 0; - IntAuto *mute_keyframe = 0; for(Track *current = first; current; current = NEXT) { long unit_start = current->to_units(edl->local_session->get_selectionstart(1), 0); - mute_keyframe = - (IntAuto*)current->automation->autos[AUTOMATION_MUTE]->get_prev_auto( - unit_start, - PLAY_FORWARD, - (Auto* &)mute_keyframe); + Auto *mute_keyframe = current->automation->autos[AUTOMATION_MUTE]-> + get_prev_auto(unit_start, PLAY_FORWARD, mute_keyframe); + IntAuto *mute_auto = (IntAuto *)mute_keyframe; result += (current->play && type == PLAY) || (current->record && type == RECORD) || (current->gang && type == GANG) || (current->draw && type == DRAW) || - (mute_keyframe->value && type == MUTE) || + (mute_auto->value && type == MUTE) || (current->expand_view && type == EXPAND); } return result; diff --git a/cinelerra-5.1/cinelerra/vattachmentpoint.C b/cinelerra-5.1/cinelerra/vattachmentpoint.C index 062db5bb..ce787f83 100644 --- a/cinelerra-5.1/cinelerra/vattachmentpoint.C +++ b/cinelerra-5.1/cinelerra/vattachmentpoint.C @@ -46,7 +46,7 @@ VAttachmentPoint::~VAttachmentPoint() void VAttachmentPoint::delete_buffer_vector() { - if(!this) printf("VAttachmentPoint::delete_buffer_vector NULL\n"); + if(!(void *)this) printf("VAttachmentPoint::delete_buffer_vector NULL\n"); if(buffer_vector) { for(int i = 0; i < virtual_plugins.total; i++) @@ -58,7 +58,7 @@ void VAttachmentPoint::delete_buffer_vector() void VAttachmentPoint::new_buffer_vector(int width, int height, int colormodel) { - if(!this) printf("VAttachmentPoint::new_buffer_vector NULL\n"); + if(!(void *)this) printf("VAttachmentPoint::new_buffer_vector NULL\n"); if(buffer_vector && (width != buffer_vector[0]->get_w() || height != buffer_vector[0]->get_h() || @@ -94,7 +94,7 @@ void VAttachmentPoint::render(VFrame *output, int debug_render, int use_opengl) { - if(!this) printf("VAttachmentPoint::render NULL\n"); + if(!(void *)this) printf("VAttachmentPoint::render NULL\n"); if(!plugin_server || !plugin->on) return; if(debug_render) diff --git a/cinelerra-5.1/cinelerra/virtualanode.C b/cinelerra-5.1/cinelerra/virtualanode.C index f922c7f7..62cb5965 100644 --- a/cinelerra-5.1/cinelerra/virtualanode.C +++ b/cinelerra-5.1/cinelerra/virtualanode.C @@ -515,53 +515,50 @@ void VirtualANode::get_pan_automation(double &slope, intercept = 0; slope = 0; - PanAuto *prev_keyframe = 0; - PanAuto *next_keyframe = 0; - prev_keyframe = (PanAuto*)autos->get_prev_auto(input_position, - direction, - (Auto* &)prev_keyframe); - next_keyframe = (PanAuto*)autos->get_next_auto(input_position, - direction, - (Auto* &)next_keyframe); + Auto *prev_keyframe = 0, *next_keyframe = 0; + prev_keyframe = autos->get_prev_auto(input_position, direction, prev_keyframe); + next_keyframe = autos->get_next_auto(input_position, direction, next_keyframe); + PanAuto *prev_pan_auto = (PanAuto *)prev_keyframe; + PanAuto *next_pan_auto = (PanAuto *)next_keyframe; if(direction == PLAY_FORWARD) { // Two distinct automation points within range - if(next_keyframe->position > prev_keyframe->position) + if(next_pan_auto->position > prev_pan_auto->position) { - slope = ((double)next_keyframe->values[channel] - prev_keyframe->values[channel]) / - ((double)next_keyframe->position - prev_keyframe->position); - intercept = ((double)input_position - prev_keyframe->position) * slope + - prev_keyframe->values[channel]; + slope = ((double)next_pan_auto->values[channel] - prev_pan_auto->values[channel]) / + ((double)next_pan_auto->position - prev_pan_auto->position); + intercept = ((double)input_position - prev_pan_auto->position) * slope + + prev_pan_auto->values[channel]; - if(next_keyframe->position < input_position + slope_len) - slope_len = next_keyframe->position - input_position; + if(next_pan_auto->position < input_position + slope_len) + slope_len = next_pan_auto->position - input_position; } else // One automation point within range { slope = 0; - intercept = prev_keyframe->values[channel]; + intercept = prev_pan_auto->values[channel]; } } else { // Two distinct automation points within range - if(next_keyframe->position < prev_keyframe->position) + if(next_pan_auto->position < prev_pan_auto->position) { - slope = ((double)next_keyframe->values[channel] - prev_keyframe->values[channel]) / - ((double)next_keyframe->position - prev_keyframe->position); - intercept = ((double)input_position - prev_keyframe->position) * slope + - prev_keyframe->values[channel]; + slope = ((double)next_pan_auto->values[channel] - prev_pan_auto->values[channel]) / + ((double)next_pan_auto->position - prev_pan_auto->position); + intercept = ((double)input_position - prev_pan_auto->position) * slope + + prev_pan_auto->values[channel]; - if(next_keyframe->position > input_position - slope_len) - slope_len = input_position - next_keyframe->position; + if(next_pan_auto->position > input_position - slope_len) + slope_len = input_position - next_pan_auto->position; } else // One automation point within range { slope = 0; - intercept = next_keyframe->values[channel]; + intercept = next_pan_auto->values[channel]; } } } diff --git a/cinelerra-5.1/cinelerra/virtualnode.C b/cinelerra-5.1/cinelerra/virtualnode.C index c441431b..f773d3ee 100644 --- a/cinelerra-5.1/cinelerra/virtualnode.C +++ b/cinelerra-5.1/cinelerra/virtualnode.C @@ -381,45 +381,45 @@ void VirtualNode::get_mute_fragment(int64_t input_position, { if(use_nudge) input_position += track->nudge; - IntAuto *prev_keyframe = 0; - IntAuto *next_keyframe = 0; - prev_keyframe = (IntAuto*)autos->get_prev_auto(input_position, - direction, - (Auto* &)prev_keyframe); - next_keyframe = (IntAuto*)autos->get_next_auto(input_position, - direction, - (Auto* &)next_keyframe); + Auto *prev_keyframe = 0; + Auto *next_keyframe = 0; + prev_keyframe = autos->get_prev_auto(input_position, + direction, prev_keyframe); + next_keyframe = autos->get_next_auto(input_position, + direction, next_keyframe); + IntAuto *prev_int_auto = (IntAuto *)prev_keyframe; + IntAuto *next_int_auto = (IntAuto *)next_keyframe; if(direction == PLAY_FORWARD) { // Two distinct keyframes within range - if(next_keyframe->position > prev_keyframe->position) + if(next_int_auto->position > prev_int_auto->position) { - mute_constant = prev_keyframe->value; + mute_constant = prev_int_auto->value; - if(next_keyframe->position < input_position + fragment_len) - fragment_len = next_keyframe->position - input_position; + if(next_int_auto->position < input_position + fragment_len) + fragment_len = next_int_auto->position - input_position; } else // One keyframe within range { - mute_constant = prev_keyframe->value; + mute_constant = prev_int_auto->value; } } else { // Two distinct keyframes within range - if(next_keyframe->position < prev_keyframe->position) + if(next_int_auto->position < prev_int_auto->position) { - mute_constant = next_keyframe->value; + mute_constant = next_int_auto->value; - if(next_keyframe->position > input_position - fragment_len) - fragment_len = input_position - next_keyframe->position; + if(next_int_auto->position > input_position - fragment_len) + fragment_len = input_position - next_int_auto->position; } else // One keyframe within range { - mute_constant = next_keyframe->value; + mute_constant = next_int_auto->value; } } } diff --git a/cinelerra-5.1/guicast/Makefile b/cinelerra-5.1/guicast/Makefile index 4bcda763..613aba1d 100644 --- a/cinelerra-5.1/guicast/Makefile +++ b/cinelerra-5.1/guicast/Makefile @@ -94,7 +94,7 @@ $(OBJDIR)/bcxfer.o: bcxfer.C xfer.C xfer.h $(CXX) `cat $(OBJDIR)/c_flags` -O3 -c $< -o $@ bcxfer.C: bccmdl.py - python < ./bccmdl.py > bcxfer.C + python2.7 < ./bccmdl.py > bcxfer.C $(OUTPUT): $(OBJS) ar rcs $(OUTPUT) `cat $(OBJDIR)/objs` diff --git a/cinelerra-5.1/libzmpeg3/audio/layer2.C b/cinelerra-5.1/libzmpeg3/audio/layer2.C index eef58669..120034a1 100644 --- a/cinelerra-5.1/libzmpeg3/audio/layer2.C +++ b/cinelerra-5.1/libzmpeg3/audio/layer2.C @@ -221,11 +221,10 @@ step_one(uint8_t *bit_alloc, int *scale) /* mono */ for( i=sblimit; --i>=0 ; alloc1+=(1<get_bits(step = alloc1->bits); - bita = bit_alloc; - scfsi = scfsi_buf; - for( i=sblimit; --i>=0 ; ) - if( *bita++ ) - *scfsi++ = (char)stream->get_bits(2); + bita = bit_alloc; + scfsi = scfsi_buf; + for( i=sblimit; --i>=0 ; ) + if( *bita++ ) *scfsi++ = (char)stream->get_bits(2); } bita = bit_alloc; diff --git a/cinelerra-5.1/libzmpeg3/libzmpeg3.h b/cinelerra-5.1/libzmpeg3/libzmpeg3.h index e1232185..6fc2c6c7 100644 --- a/cinelerra-5.1/libzmpeg3/libzmpeg3.h +++ b/cinelerra-5.1/libzmpeg3/libzmpeg3.h @@ -94,7 +94,7 @@ extern "C" { #define new_memset(s) \ void *operator new(size_t n) { \ - void *t = (void*) new char[n]; \ + void * volatile t = (void*) new char[n]; \ memset(t,s,n); \ return t; \ } \ @@ -102,7 +102,7 @@ extern "C" { delete[](char*)t; \ } \ void *operator new[](size_t n) { \ - void *t = (void*) new char[n]; \ + void * volatile t = (void*) new char[n]; \ memset(t,s,n); \ return t; \ } \ diff --git a/cinelerra-5.1/plugin_config b/cinelerra-5.1/plugin_config index 77cb4c3f..41afda3c 100644 --- a/cinelerra-5.1/plugin_config +++ b/cinelerra-5.1/plugin_config @@ -18,8 +18,8 @@ $(shell echo $(LFLAGS) > $(OBJDIR)/l_flags) ifeq ($(OUTPUT_THEME),) -$(OUTPUT): $(OBJS) $(OUTPUT_DIR) $(OUTPUT_PNGS) - $(LDLINKER) -o $(OUTPUT) $(OBJS) `cat $(OBJDIR)/l_flags` +$(OUTPUT): $(OBJS) $(OUTPUT_DIR) $(OUTPUT_PNGS) $(OUTPUT_BINS) + $(LDLINKER) -o $(OUTPUT) $(OBJS) $(OUTPUT_BINS) `cat $(OBJDIR)/l_flags` $(if $(findstring -g,$(CFLAGS)),objcopy --only-keep-debug $(OUTPUT) $(OUTPUT_G)) $(if $(findstring -ggdb,$(CFLAGS)),,strip $(OUTPUT)) diff --git a/cinelerra-5.1/plugins/C41/c41.C b/cinelerra-5.1/plugins/C41/c41.C index ee59aec5..c2d59da4 100644 --- a/cinelerra-5.1/plugins/C41/c41.C +++ b/cinelerra-5.1/plugins/C41/c41.C @@ -460,7 +460,8 @@ float C41Effect::myLog2(float i) float x; float y; float LogBodge = 0.346607f; - x = *(int *)&i; + union { float f; int i; } v; + v.f = i; x = v.i; x *= 1.0 / (1 << 23); // 1/pow(2,23); x = x - 127; @@ -478,7 +479,8 @@ float C41Effect::myPow2(float i) x = i + 127 - y; x *= (1 << 23); - *(int*) &x = (int)x; + union { float f; int i; } v; + v.i = (int)x; x = v.f; return x; } diff --git a/cinelerra-5.1/plugins/chromakeyhsv/Makefile b/cinelerra-5.1/plugins/chromakeyhsv/Makefile index 5b9fb3ce..d1a40d36 100644 --- a/cinelerra-5.1/plugins/chromakeyhsv/Makefile +++ b/cinelerra-5.1/plugins/chromakeyhsv/Makefile @@ -1,13 +1,13 @@ include ../../plugin_defs PLUGIN = chromakeyhsv -SHADER := $(OBJDIR)/chromakey_sl.o +OUTPUT_BINS := $(OBJDIR)/chromakey_sl.o OBJS := $(OBJDIR)/chromakey.o $(SHADER) include ../../plugin_config $(OBJDIR)/chromakey.o: chromakey.C -$(SHADER): chromakey.sl +$(OUTPUT_BINS): chromakey.sl cd $(OBJDIR) && \ ../../../guicast/$(OBJDIR)/bootstrap -s chromakey_sl.o ../chromakey.sl diff --git a/cinelerra-5.1/plugins/freeverb/Components/denormals.h b/cinelerra-5.1/plugins/freeverb/Components/denormals.h index bb100d31..a6d599a6 100644 --- a/cinelerra-5.1/plugins/freeverb/Components/denormals.h +++ b/cinelerra-5.1/plugins/freeverb/Components/denormals.h @@ -1,19 +1,27 @@ -// Macro for killing denormalled numbers -// -// Written by Jezar at Dreampoint, June 2000 -// http://www.dreampoint.co.uk -// Based on IS_DENORMAL macro by Jon Watte -// This code is public domain - -#ifndef _denormals_ -#define _denormals_ - -#define undenormalise(sample) if(((*(unsigned int*)&sample)&0x7f800000)==0) sample=0.0f - -#endif//_denormals_ - -//ends - - - - +// Macro for killing denormalled numbers +// +// Written by Jezar at Dreampoint, June 2000 +// http://www.dreampoint.co.uk +// Based on IS_DENORMAL macro by Jon Watte +// This code is public domain + +#ifndef _denormals_ +#define _denormals_ + +/* +#define undenormalise(sample) \ + if(((*(unsigned int*)&sample)&0x7f800000)==0) sample=0.0f +*/ + +static inline void undenormalise(float &sample) { + union { float f; unsigned int u; } v; v.f = sample; + if( !(v.u & 0x7f800000) ) sample=0.f; +} + +#endif//_denormals_ + +//ends + + + + -- 2.26.2