bunch-o compiler bitch'n
authorGood Guy <[email protected]>
Tue, 18 Jul 2017 14:36:26 +0000 (08:36 -0600)
committerGood Guy <[email protected]>
Tue, 18 Jul 2017 14:36:26 +0000 (08:36 -0600)
22 files changed:
cinelerra-5.1/cfg-cv.sh
cinelerra-5.1/cinelerra/awindowgui.C
cinelerra-5.1/cinelerra/bdcreate.C
cinelerra-5.1/cinelerra/dcraw.C
cinelerra-5.1/cinelerra/dcraw.h
cinelerra-5.1/cinelerra/dvdcreate.C
cinelerra-5.1/cinelerra/exportedl.C
cinelerra-5.1/cinelerra/ffmpeg.C
cinelerra-5.1/cinelerra/filempeg.C
cinelerra-5.1/cinelerra/fileogg.C
cinelerra-5.1/cinelerra/packagerenderer.C
cinelerra-5.1/cinelerra/plugindialog.C
cinelerra-5.1/configure.ac
cinelerra-5.1/guicast/filesystem.C
cinelerra-5.1/libzmpeg3/libzmpeg3.h
cinelerra-5.1/plugins/motion-cv/motion-cv.C
cinelerra-5.1/plugins/motion/motion.C
cinelerra-5.1/plugins/motion51/motion51.C
cinelerra-5.1/plugins/svg/svg.C
cinelerra-5.1/plugins/svg/svgwin.C
cinelerra-5.1/plugins/titler/titlerwindow.C
cinelerra-5.1/plugins/titler/titlerwindow.h

index 5efad07de58528218f9af023942073754b12da7b..3ae46732cde71d3c6d494329d4a3f7e4d9609c7e 100755 (executable)
@@ -5,7 +5,10 @@
 cin="$1"
 THIRDPARTY=`pwd`/thirdparty
 unset LIBS LDFLAGS CFLAGS CPPFLAGS CXXFLAGS
-
+export ac_cv_header_xmmintrin_h=no
+for f in ./quicktime/Makefile.am ./libmpeg3/Makefile.am; do
+  sed -e 's/-Wl,--no-undefined//' -i $f
+done
 rm -rf thirdparty; cp -a $cin/thirdparty .
 for f in configure.ac Makefile.am autogen.sh; do mv $f $f.cv; cp -a $cin/$f .; done
 mv m4 m4.cv
@@ -83,7 +86,6 @@ echo LDFLAGS=$LDFLAGS
 echo LIBS=$LIBS
 echo CFLAGS=$CFLAGS
 
-export ac_cv_header_xmmintrin_h=no
 # -lmxxxxx dies, feed it a -lm early to prevent misformed parameters
 export LIBS="-la52 -ldjbfft -lfaac -lfaad -lHalf -lIex -lIexMath -lIlmThread -lImath -llavfile -llavjpeg -lm -lmjpegutils -lmmxsse -lmp3lame -lmp4ff -lmpeg2encpp -lmpgdecoder -lmplex2 -logg -lvorbis -lvorbisenc -lvorbisfile -lx264 -lyuvfilters -lpthread -ldl"
 # po Makefile construction error: skip it
@@ -96,11 +98,15 @@ find thirdparty/ -name .libs | while read f ; do ( cd $f; ln -s . .libs ); done
 
 ./configure
 
+echo "Run:"
+echo "export ac_cv_header_xmmintrin_h=no"
+echo "export THIRDPARTY=\"$THIRDPARTY\""
 exit
 
 # have to rebuild these by hand
-# cd plugins/libeffecttv/.libs/; rm libeffectv.a; ar r libeffecttv.a effecttv.o
-# cd quicktime/encore50/.libs/; rm libencore.a; ar r libencore.a *.o
+# have to get rid of  -Wl,--no-undefined"
+# cd plugins/libeffecttv/.libs/; \rm -f libeffecttv.a; ar r libeffecttv.a effecttv.o
+# cd quicktime/encore50/.libs/; \rm -f libencore.a; ar r libencore.a *.o
 # cd quicktime; vi Makefile; remove -Wl,--no-undefined from:, make
 #   libquicktimecv_la_LDFLAGS = -version-info 1:0:0 -release 1.6.0
 
index 039e8400f93a885f4e368a19803791c46ffb9801..f7aa770dbd368f295fa1df80e7a016fa4f05efc8 100644 (file)
@@ -826,7 +826,8 @@ void AWindowRemovePlugin::handle_close_event(int result)
                mwindow->plugindb->remove(plugin);
                remove(plugin_path);
                char index_path[BCTEXTLEN];
-               sprintf(index_path, "%s/%s", mwindow->preferences->plugin_dir, PLUGIN_FILE);
+               snprintf(index_path, sizeof(index_path), "%s/%s",
+                       mwindow->preferences->plugin_dir, PLUGIN_FILE);
                remove(index_path);
                char png_path[BCTEXTLEN];
                if( plugin->get_theme_png_path(png_path, mwindow->preferences->theme) )
index 14b978c103d2c062203303b0424975994cbb1ba2..3ed07e48d70f96671535c9856f0362425b06c808 100644 (file)
@@ -416,8 +416,8 @@ void CreateBD_Thread::handle_close_event(int result)
        }
 
        char asset_dir[BCTEXTLEN], jobs_path[BCTEXTLEN];
-       sprintf(asset_dir, "%s/%s", tmp_path, asset_title);
-       sprintf(jobs_path, "%s/bd.jobs", asset_dir);
+       snprintf(asset_dir, sizeof(asset_dir), "%s/%s", tmp_path, asset_title);
+       snprintf(jobs_path, sizeof(jobs_path), "%s/bd.jobs", asset_dir);
        mwindow->batch_render->reset(jobs_path);
        int ret = create_bd_jobs(&mwindow->batch_render->jobs, asset_dir);
        mwindow->undo->update_undo_after(_("create bd"), LOAD_ALL);
index 65d880560a3109484eacb0f7cea7e0bef57a1a59..188ae3194594229c695e928ab0601897f656f410 100644 (file)
@@ -92,6 +92,14 @@ typedef uint64_t UINT64;
 
 #include "dcraw.h"
 
+//const static data
+const double DCRaw_data::xyz_rgb[3][3] = {             /* XYZ from RGB */
+       { 0.412453, 0.357580, 0.180423 },
+       { 0.212671, 0.715160, 0.072169 },
+       { 0.019334, 0.119193, 0.950227 } };
+const float DCRaw_data::d65_white[3] = {
+         0.950456, 1.000000, 1.088754 };
+
 /*
    All global variables are defined here, and all functions that
    access them are prefixed with "CLASS".  Note that a thread-safe
@@ -3264,7 +3272,7 @@ short * CLASS foveon_make_curve (double max, double mul, double filt)
 
   if (!filt) filt = 0.8;
   size = 4*M_PI*max / filt;
-  if (size == UINT_MAX) size--;
+  if (size > INT_MAX-1) size = INT_MAX-1;
   curve = (short *) calloc (size+1, sizeof *curve);
   merror (curve, "foveon_make_curve()");
   curve[0] = size;
@@ -3298,19 +3306,34 @@ void CLASS foveon_interpolate()
 {
   static const short hood[] = { -1,-1, -1,0, -1,1, 0,-1, 0,1, 1,-1, 1,0, 1,1 };
   short *pix, prev[3], *curve[8], (*shrink)[3];
-  float cfilt=0, ddft[3][3][2], ppm[3][3][3];
+  float cfilt, ddft[3][3][2], ppm[3][3][3];
   float cam_xyz[3][3], correct[3][3], last[3][3], trans[3][3];
   float chroma_dq[3], color_dq[3], diag[3][3], div[3];
   float (*black)[3], (*sgain)[3], (*sgrow)[3];
   float fsum[3], val, frow, num;
   int row, col, c, i, j, diff, sgx, irow, sum, min, max, limit;
   int dscr[2][2], dstb[4], (*smrow[7])[3], total[4], ipix[3];
-  int work[3][3], smlast, smred, smred_p=0, dev[3];
+  int work[3][3], smlast, smred, smred_p, dev[3];
   int satlev[3], keep[4], active[4];
   unsigned dim[3], *badpix;
-  double dsum=0, trsum[3];
+  double dsum, trsum[3];
   char str[128];
   const char* cp;
+// clear local storage
+  pix = 0; ZERO(prev); ZERO(curve); ZERO(shrink);
+  cfilt = 0; ZERO(ddft); ZERO(ppm);
+  ZERO(cam_xyz); ZERO(correct); ZERO(last); ZERO(trans);
+  ZERO(chroma_dq); ZERO(color_dq); ZERO(diag); ZERO(div);
+  ZERO(black); ZERO(sgain); ZERO(sgrow);
+  ZERO(fsum); val = frow = num = 0;
+  row = col = c = i = j = diff = sgx = irow = sum = min = max = limit = 0;
+  ZERO(dscr); ZERO(dstb); ZERO(smrow); ZERO(total); ZERO(ipix);
+  ZERO(work); ZERO(smlast); ZERO(smred); smred_p=0; ZERO(dev);
+  ZERO(satlev); ZERO(keep); ZERO(active);
+  ZERO(dim); badpix = 0;
+  dsum = 0; ZERO(trsum);
+  ZERO(str);
+  cp = 0;
 
   if (verbose)
     fprintf (stderr,_("Foveon interpolation...\n"));
@@ -6017,7 +6040,7 @@ guess_cfa_pc:
       case 61450:
        cblack[4] = cblack[5] = MIN(sqrt(len),64);
       case 50714:                      /* BlackLevel */
-       if (!(cblack[4] * cblack[5]))
+       if ((cblack[4] * cblack[5])==0)
          cblack[4] = cblack[5] = 1;
        FORC (cblack[4] * cblack[5])
          cblack[6+c] = getreal(type);
index c0f567791a660c4b39510ee5322761507028fea9..0f04db36ef40904eb66e98aa3de260418e303896 100644 (file)
@@ -87,6 +87,10 @@ public:
        unsigned fov_huff[1024];
        float clb_cbrt[0x10000], clb_xyz_cam[3][4];
        uchar pana_buf[0x4000];  int pana_vbits;
+// const static data
+       static const double xyz_rgb[3][3];
+       static const float d65_white[3];
+
 };
 
 class DCRaw : public DCRaw_data {
@@ -275,13 +279,6 @@ private:
        void write_ppm_tiff(void);
        void write_cinelerra(void);
        void reset();
-//const data
-       const double xyz_rgb[3][3] = {                  /* XYZ from RGB */
-               { 0.412453, 0.357580, 0.180423 },
-               { 0.212671, 0.715160, 0.072169 },
-               { 0.019334, 0.119193, 0.950227 } };
-       const float d65_white[3] = { 0.950456, 1, 1.088754 };
-
 public:
        DCRaw();
        ~DCRaw();
index 6a870a72d980e036b6bffae8ae2b6afa1559b391..e7eb1db2c127da9f68d52896610b4cd1da1c16b3 100644 (file)
@@ -438,8 +438,8 @@ void CreateDVD_Thread::handle_close_event(int result)
                insert_video_plugin("Histogram", &keyframe);
        }
        char asset_dir[BCTEXTLEN], jobs_path[BCTEXTLEN];
-       sprintf(asset_dir, "%s/%s", tmp_path, asset_title);
-       sprintf(jobs_path, "%s/dvd.jobs", asset_dir);
+       snprintf(asset_dir, sizeof(asset_dir), "%s/%s", tmp_path, asset_title);
+       snprintf(jobs_path, sizeof(jobs_path), "%s/dvd.jobs", asset_dir);
        mwindow->batch_render->reset(jobs_path);
        int ret = create_dvd_jobs(&mwindow->batch_render->jobs, asset_dir);
        mwindow->undo->update_undo_after(_("create dvd"), LOAD_ALL);
index 06982c95cd8eee07b6ed94ff2e062d9f7a8fcfac..7c8afaa24b6a9ef521b0f7677c7bf86faa2ebd33 100644 (file)
@@ -365,8 +365,7 @@ ExportEDLWindow::~ExportEDLWindow()
 void ExportEDLWindow::create_objects()
 {
        int x = 5, y = 5;
-       add_subwindow(new BC_Title(x,
-               y,
+       add_subwindow(new BC_Title(x, y,
                        _("Select a file to export to:")));
        y += 25;
 
@@ -399,7 +398,7 @@ void ExportEDLWindow::create_objects()
                track = track->next)
        {
 
-               char tmp[10];
+               char tmp[16];
                sprintf(tmp, "%i\n", serial+1);
 
                BC_ListBoxItem *listitem = new BC_ListBoxItem(tmp);
index 70440b64c307b3d782081e0d212b82ef3ffea8aa..f79a240ef5c844d091070f205e3dd68e1a799ee5 100644 (file)
@@ -557,7 +557,7 @@ int FFStream::seek(int64_t no, double rate)
                }
        }
        if( ret < 0 ) {
-printf("** seek fail %ld, %ld\n", pos, tstmp);
+printf("** seek fail %jd, %jd\n", pos, tstmp);
                seeked = need_packet = 0;
                st_eof(flushed=1);
                return -1;
index 8ddf44f17c67195c7fa4c4091b869a61b5d6f567..0526875ba4c73debd051670c56affaa60ec53fd9 100644 (file)
@@ -495,7 +495,8 @@ int FileMPEG::open_file(int rd, int wr)
                        if(!result)
                        {
                                const char *exec_path = File::get_cinlib_path();
-                               sprintf(mjpeg_command, "%s/%s", exec_path, HVPEG_EXE);
+                               snprintf(mjpeg_command, sizeof(mjpeg_command),
+                                       "%s/%s", exec_path, HVPEG_EXE);
                                append_vcommand_line(mjpeg_command);
 
                                if(asset->aspect_ratio > 0)
@@ -545,7 +546,8 @@ int FileMPEG::open_file(int rd, int wr)
 //  this one is cinelerra-x.x.x/thirdparty/mjpegtools/mpeg2enc
                {
                        const char *exec_path = File::get_cinlib_path();
-                       sprintf(mjpeg_command, "%s/%s -v 0 ", exec_path, MJPEG_EXE);
+                       snprintf(mjpeg_command, sizeof(mjpeg_command),
+                               "%s/%s -v 0 ", exec_path, MJPEG_EXE);
 
 // Must disable interlacing if MPEG-1
                        switch (asset->vmpeg_preset)
@@ -560,18 +562,15 @@ int FileMPEG::open_file(int rd, int wr)
 // quantization of 1 when bitrate is fixed.  Perfectly intuitive.
                        if(asset->vmpeg_fix_bitrate)
                        {
-                               sprintf(string, " -b %d -q 1", asset->vmpeg_bitrate / 1000);
+                               snprintf(string, sizeof(string),
+                                       " -b %d -q 1", asset->vmpeg_bitrate / 1000);
                        }
                        else
                        {
-                               sprintf(string, " -b 0 -q %d", asset->vmpeg_quantization);
+                               snprintf(string, sizeof(string),
+                                       " -b 0 -q %d", asset->vmpeg_quantization);
                        }
-                       strcat(mjpeg_command, string);
-
-
-
-
-
+                       strncat(mjpeg_command, string, sizeof(mjpeg_command));
 
 // Aspect ratio
                        int aspect_ratio_code = -1;
@@ -599,7 +598,7 @@ int FileMPEG::open_file(int rd, int wr)
                                aspect_ratio_code = 2;
                        }
                        sprintf(string, " -a %d", aspect_ratio_code);
-                       strcat(mjpeg_command, string);
+                       strncat(mjpeg_command, string, sizeof(mjpeg_command));
 
 
 
@@ -623,43 +622,49 @@ int FileMPEG::open_file(int rd, int wr)
                                eprintf(_("Unsupported frame rate %f\n"), asset->frame_rate);
                        }
                        sprintf(string, " -F %d", frame_rate_code);
-                       strcat(mjpeg_command, string);
+                       strncat(mjpeg_command, string, sizeof(mjpeg_command));
 
 
 
 
 
-                       strcat(mjpeg_command,
-                               asset->vmpeg_progressive ? " -I 0" : " -I 1");
+                       strncat(mjpeg_command,
+                               asset->vmpeg_progressive ? " -I 0" : " -I 1",
+                               sizeof(mjpeg_command));
 
 
 
                        sprintf(string, " -M %d", file->cpus);
-                       strcat(mjpeg_command, string);
+                       strncat(mjpeg_command, string, sizeof(mjpeg_command));
 
 
                        if(!asset->vmpeg_progressive)
                        {
-                               strcat(mjpeg_command, asset->vmpeg_field_order ? " -z b" : " -z t");
+                               strncat(mjpeg_command,
+                                       asset->vmpeg_field_order ? " -z b" : " -z t",
+                                       sizeof(mjpeg_command));
                        }
 
 
-                       sprintf(string, " -f %d", asset->vmpeg_preset);
-                       strcat(mjpeg_command, string);
+                       snprintf(string, sizeof(string), " -f %d", asset->vmpeg_preset);
+                       strncat(mjpeg_command, string, sizeof(mjpeg_command));
 
 
-                       sprintf(string, " -g %d -G %d", asset->vmpeg_iframe_distance, asset->vmpeg_iframe_distance);
-                       strcat(mjpeg_command, string);
+                       snprintf(string, sizeof(string),
+                               " -g %d -G %d", asset->vmpeg_iframe_distance, asset->vmpeg_iframe_distance);
+                       strncat(mjpeg_command, string, sizeof(mjpeg_command));
 
 
-                       if(asset->vmpeg_seq_codes) strcat(mjpeg_command, " -s");
+                       if(asset->vmpeg_seq_codes)
+                               strncat(mjpeg_command, " -s", sizeof(mjpeg_command));
 
 
-                       sprintf(string, " -R %d", CLAMP(asset->vmpeg_pframe_distance, 0, 2));
-                       strcat(mjpeg_command, string);
+                       snprintf(string, sizeof(string),
+                               " -R %d", CLAMP(asset->vmpeg_pframe_distance, 0, 2));
+                       strncat(mjpeg_command, string, sizeof(mjpeg_command));
 
-                       sprintf(string, " -o '%s'", asset->path);
-                       strcat(mjpeg_command, string);
+                       snprintf(string, sizeof(string), " -o '%s'", asset->path);
+                       strncat(mjpeg_command, string, sizeof(mjpeg_command));
 
 
 
index 4f24a88e989702cf7fe398b8f155657d838052c1..0c718fba26d979b739f5947738a4716ca4fe153c 100644 (file)
@@ -2379,7 +2379,9 @@ int PackagingEngineOGG::create_packages_single_farm(
        if (default_asset->audio_data)
        {
                packages[local_current_package] = new RenderPackage;
-               sprintf(packages[current_package]->path, "%s.audio", default_asset->path);
+               snprintf(packages[current_package]->path,
+                       sizeof(packages[current_package]->path),
+                       "%s.audio", default_asset->path);
                local_current_package++;
        }
 
index d4341493dce1a8d4b4bce441a3ea842383040a20..178082a42449eff849b864df011e7de647f5ee6c 100644 (file)
@@ -152,9 +152,10 @@ void PackageRenderer::create_output()
        asset = new Asset(*default_asset);
 
        if(!get_master() && preferences->renderfarm_vfs && preferences->use_renderfarm)
-               sprintf(asset->path, RENDERFARM_FS_PREFIX "%s", package->path);
+               snprintf(asset->path, sizeof(asset->path),
+                       RENDERFARM_FS_PREFIX "%s", package->path);
        else
-               strcpy(asset->path, package->path);
+               strncpy(asset->path, package->path, sizeof(asset->path));
 
        file = new File;
 
@@ -171,7 +172,7 @@ void PackageRenderer::create_output()
        {
 // open failed
                char string[BCTEXTLEN];
-               sprintf(string, _("Couldn't open %s"), asset->path);
+               snprintf(string, sizeof(string), _("Couldn't open %s"), asset->path);
                ErrorBox error(_(PROGRAM_NAME ": Error"),
                        mwindow->gui->get_abs_cursor_x(1),
                        mwindow->gui->get_abs_cursor_y(1));
index b1091c8bc4d0b5df38190bcc36f825bd64a61d4f..172eaf91acb13b75e777a39d73baf7bdc3a732f9 100644 (file)
@@ -292,7 +292,7 @@ void PluginDialog::create_objects()
                char *plugin_title = plugin->title;
                char string[BCTEXTLEN];
 
-               sprintf(string, "%s: %s", track_title, _(plugin_title));
+               snprintf(string, sizeof(string), "%s: %s", track_title, _(plugin_title));
                shared_data.append(new BC_ListBoxItem(string));
        }
        for(int i = 0; i < module_locations.total; i++)
index d66079337ed0bf8f2db72bf3e97837272f517b0e..48f55f28f79ebc56fd99384ccaeab59b6335f21a 100644 (file)
@@ -597,7 +597,6 @@ for dep in \
         libtheora/libogg libtheora/libvorbis ; do
   lib=`dirname $dep`;  needs=`basename $dep`
   eval pkg_lib="\$PKG_$lib"; eval needs_lib="\$HAVE_$needs";
-  echo "dep lib=$lib, needs=$needs, pkg_lib=$pkg_lib, needs_lib=$needs_lib" > /dev/tty
   if test "x$pkg_lib" != "xno"; then
     eval "PKG_$needs=yes"
   fi
@@ -643,9 +642,7 @@ PKG_PROVIDE([libtheora])
 PKG_PROVIDE([libuuid])
 PKG_PROVIDE([libvorbis])
 PKG_PROVIDE([mjpegtools])
-echo "WANT_OPENEXR = $WANT_OPENEXR" > /dev/tty
 PKG_PROVIDE([openexr], [$WANT_OPENEXR])
-echo "PKG_openexr = $PKG_openexr" > /dev/tty
 PKG_PROVIDE([openjpeg])
 PKG_PROVIDE([tiff])
 PKG_PROVIDE([twolame])
index 50c38a1c14c1c76dbab0a38c5edf09205c9c5fa3..86544cc64fa6982502f463ecd5a500733fc1fd59 100644 (file)
@@ -643,18 +643,14 @@ int FileSystem::parse_directories(char *new_dir)
                        strcpy(string, new_dir);
                }
                else
-               if(!is_root_dir(current_dir))
                {
-// current directory is not root
-                       if(current_dir[strlen(current_dir) - 1] == '/')
-// current_dir already has ending /
-                       sprintf(string, "%s%s", current_dir, new_dir);
-                       else
-// need ending /
-                       sprintf(string, "%s/%s", current_dir, new_dir);
+                       snprintf(string, sizeof(string),
+                               is_root_dir(current_dir) ||
+                               current_dir[strlen(current_dir)-1] == '/' ?
+// current directory is root or already has ending /
+                                "%s%s" : "%s/%s",
+                               current_dir, new_dir);
                }
-               else
-                       sprintf(string, "%s%s", current_dir, new_dir);
 
 //printf("FileSystem::parse_directories 3 %s %s\n", new_dir, string);
                strcpy(new_dir, string);
index 6fc2c6c712ff98cc14015466c7d79f897b6d0afa..712d1ca00dffd62644651ff5d3b75c3d4ecbb05f 100644 (file)
@@ -2846,9 +2846,9 @@ public:
   }
 
   static inline void complete_path(char *full_path, char *path) {
-    char dir[zmpeg3_t::STRLEN];
+    char dir[STRLEN];
     if( path[0] != '/' && getcwd(dir, sizeof(dir)) )
-      sprintf(full_path, "%s/%s", dir, path);
+      snprintf(full_path, STRLEN, "%s/%s", dir, path);
     else
       strcpy(full_path, path);
   }
@@ -2875,7 +2875,7 @@ public:
   }
 
   static inline void joinpath(char *path, char *dir, char *filename) {
-    sprintf(path, "%s/%s", dir, filename);
+    snprintf(path, STRLEN, "%s/%s", dir, filename);
   }
 
   static inline int64_t path_total_bytes(char *path) {
index 2359e0e253cb7efcca5ea168ec9ca79f28813326..b434e42a7b6c6b9756b92da357e3416c086a4bbd 100644 (file)
@@ -652,7 +652,7 @@ printf("MotionCVMain::process_buffer 1 start_position=%jd\n", start_position);
            config.mode2 == MotionCVConfig::SAVE ) {
                reset_cache_file();
                char save_file[BCTEXTLEN];
-               sprintf(save_file, "%s.sav", config.tracking_file);
+               snprintf(save_file, sizeof(save_file), "%s.sav", config.tracking_file);
 #ifdef DEBUG
 printf("MotionCVMain::process_buffer 2 rename tracking file: %s to %s\n",
  config.tracking_file, save_file);
@@ -1320,7 +1320,7 @@ int MotionCVMain::put_cache_line(const char *line)
        if( key == active_key ) return 1;
        if( !active_fp ) {
                close_cache_file();
-               sprintf(cache_file, "%s.bak", config.tracking_file);
+               snprintf(cache_file, sizeof(cache_file), "%s.bak", config.tracking_file);
                ::rename(config.tracking_file, cache_file);
                if( !(active_fp = fopen(config.tracking_file, "w")) ) {
                        perror(config.tracking_file);
index b1eb5b8e38b6e9550b8df0d364cbf0daa59b9d1e..db9235eccb4ecf2ddf6a973ca90b3e33fb1cf438 100644 (file)
@@ -701,7 +701,7 @@ printf("MotionMain::process_buffer %d start_position=%jd\n", __LINE__, start_pos
            config.tracking_type == MotionScan::SAVE ) {
                reset_cache_file();
                char save_file[BCTEXTLEN];
-               sprintf(save_file,"%s.bak", config.tracking_file);
+               snprintf(save_file, sizeof(save_file), "%s.bak", config.tracking_file);
 #ifdef DEBUG
 printf("MotionMain::process_buffer 2 rename tracking file: %s to %s\n",
  config.tracking_file, save_file);
@@ -1181,7 +1181,7 @@ int MotionMain::put_cache_line(const char *line)
        if( key == active_key ) return 1;
        if( !active_fp ) {
                close_cache_file();
-               sprintf(cache_file, "%s.bak", config.tracking_file);
+               snprintf(cache_file, sizeof(cache_file), "%s.bak", config.tracking_file);
                ::rename(config.tracking_file, cache_file);
                if( !(active_fp = fopen(config.tracking_file, "w")) ) {
                        perror(config.tracking_file);
index 402a5a00eecf22869a529a05e123f78e37f66760..483c6e5fc93419d63542ae0ad6b86eafbd4dbaad 100644 (file)
@@ -686,7 +686,7 @@ int Motion51Main::put_cache_line(const char *line)
        if( key == active_key ) return 1;
        if( !active_fp ) {
                close_cache_file();
-               sprintf(cache_file, "%s.bak", config.tracking_file);
+               snprintf(cache_file, sizeof(cache_file), "%s.bak", config.tracking_file);
                ::rename(config.tracking_file, cache_file);
                if( !(active_fp = fopen(config.tracking_file, "w")) ) {
                        perror(config.tracking_file);
index 842161aef515a863ec2597a2c5b5ec324373c2d6..af4a79d467df526af7fd7f33a77117c1ba3affaa 100644 (file)
@@ -178,7 +178,7 @@ int SvgMain::process_realtime(VFrame *input, VFrame *output)
                int fd = ms_time < config.ms_time ? -1 : open(filename_png, O_RDWR);
                if( fd < 0 ) { // file does not exist, export it
                        char command[BCTEXTLEN];
-                       sprintf(command,
+                       snprintf(command, sizeof(command),
                                "inkscape --without-gui --export-background=0x000000 "
                                "--export-background-opacity=0 -d %f %s --export-png=%s",
                                config.dpi, config.svg_file, filename_png);
index 3269c61f173d124e679609aa495cb9bf45853ef1..9931a8ddc218c5fa3f86f05b3a6d0401ce9c1b04 100644 (file)
@@ -358,7 +358,8 @@ void SvgInkscapeThread::run()
 {
 // Runs the inkscape
        char command[1024];
-       sprintf(command, "inkscape --with-gui %s", edit->client->config.svg_file);
+       snprintf(command, sizeof(command),
+               "inkscape --with-gui %s", edit->client->config.svg_file);
        printf(_("Running external SVG editor: %s\n"), command);
 
        enable_cancel();
index 9adf4e262931182aece1eaee60efffc286da6f6c..74a4aadf883bf968396c6ec6c8620137612dbbbf 100644 (file)
@@ -1423,7 +1423,7 @@ int TitleCurPopup::handle_event()
        return 1;
 }
 
-void TitleCurSubMenu::add_subitem(int popup_type, va_list ap, const char *fmt)
+void TitleCurSubMenu::add_subitemx(int popup_type, va_list ap, const char *fmt)
 {
        char item[BCSTRLEN];
        vsnprintf(item, sizeof(item)-1, fmt, ap);
index 1f968301b82f73c8435f604651e8cc5a644c2951..96086c5e28433ac4b18f29050e5e52a6983c30ab 100644 (file)
@@ -551,12 +551,12 @@ class TitleCurSubMenu : public BC_SubMenu
 public:
         TitleCurSubMenu(TitleCurItem *cur_item);
         ~TitleCurSubMenu();
-       void add_subitem(int popup_type, va_list ap, const char *fmt);
+       void add_subitemx(int popup_type, va_list ap, const char *fmt);
        void add_subitem(int popup_type, const char *fmt,...) { va_list ap;
-               va_start(ap, fmt); add_subitem(popup_type, ap, fmt); va_end(ap);
+               va_start(ap, fmt); add_subitemx(popup_type, ap, fmt); va_end(ap);
        }
        void add_subitem(const char *fmt,...) { va_list ap;
-               va_start(ap, fmt); add_subitem(POPUP_NONE, ap, fmt); va_end(ap);
+               va_start(ap, fmt); add_subitemx(POPUP_NONE, ap, fmt); va_end(ap);
        }
         TitleCurItem *cur_item;
 };