[gimp-gap/gap-2-8] fixed movpath xml load, bugs #730034, #730239 and gcc warnings



commit 0a935e05674234f05a8ec07440442b4dfba4372f
Author: Wolfgang Hofer <wolfgangh svn gnome org>
Date:   Wed May 21 20:20:32 2014 +0200

    fixed movpath xml load, bugs #730034, #730239 and gcc warnings

 ChangeLog                                  |  121 +++++++++++
 gap/gap_accel_da.c                         |    2 +-
 gap/gap_arr_dialog.c                       |   24 +-
 gap/gap_audio_wav.c                        |    4 +-
 gap/gap_blend_fill_main.c                  |   29 ++-
 gap/gap_colordiff.c                        |   28 ++--
 gap/gap_colormask_dialog.c                 |   41 ++--
 gap/gap_colormask_exec.c                   |   28 +--
 gap/gap_colormask_file.c                   |    5 +-
 gap/gap_colormask_main.c                   |    5 +-
 gap/gap_dbbrowser_utils.c                  |   20 +-
 gap/gap_decode_mplayer_main.c              |    7 -
 gap/gap_detail_align_exec.c                |    8 +-
 gap/gap_detail_tracking_exec.c             |   16 +-
 gap/gap_detail_tracking_main.c             |   10 +-
 gap/gap_edge_detection.c                   |    7 +-
 gap/gap_filter_iterators.c                 |    4 +-
 gap/gap_fire_pattern.c                     |   46 ++--
 gap/gap_fmac_base.c                        |   27 ++-
 gap/gap_fmac_context.c                     |   16 +-
 gap/gap_fmac_main.c                        |   18 --
 gap/gap_fmac_varying_main.c                |    8 +-
 gap/gap_frame_fetcher.c                    |   26 +--
 gap/gap_image.c                            |    9 +-
 gap/gap_layer_copy.c                       |    4 +-
 gap/gap_lib.c                              |    8 +-
 gap/gap_locate.c                           |    2 +-
 gap/gap_main.c                             |    3 +-
 gap/gap_mod_layer.c                        |   10 +-
 gap/gap_mod_layer_dialog.c                 |   23 ++-
 gap/gap_morph_dialog.c                     |    8 +-
 gap/gap_morph_exec.c                       |    9 +-
 gap/gap_morph_shape.c                      |    5 +-
 gap/gap_morph_tween_dialog.c               |    8 +-
 gap/gap_mov_dialog.c                       |   50 +++--
 gap/gap_mov_exec.c                         |  201 ++++++++++++------
 gap/gap_mov_exec.h                         |    1 +
 gap/gap_mov_main.c                         |    3 +-
 gap/gap_mov_render.c                       |    4 +-
 gap/gap_mov_xml_par.c                      |   18 +-
 gap/gap_navigator_dialog.c                 |   34 ++--
 gap/gap_onion_base.c                       |    1 -
 gap/gap_onion_dialog.c                     |   10 +-
 gap/gap_onion_main.c                       |    4 -
 gap/gap_pdb_calls.c                        |    9 +-
 gap/gap_pixelrgn.c                         |    4 +-
 gap/gap_player_cache.c                     |   40 ++--
 gap/gap_player_dialog.c                    |   44 ++--
 gap/gap_pview_da.c                         |   11 +-
 gap/gap_range_ops.c                        |   19 +--
 gap/gap_stock.c                            |    6 +-
 gap/gap_story_dialog.c                     |  135 +++++++-----
 gap/gap_story_file.c                       |   10 +-
 gap/gap_story_properties.c                 |   61 +++---
 gap/gap_story_render_lossless.c            |   17 +--
 gap/gap_story_render_processor.c           |  241 ++++++++++------------
 gap/gap_story_render_processor.h           |    2 +-
 gap/gap_story_section_properties.c         |   37 ++--
 gap/gap_story_sox.c                        |    4 -
 gap/gap_story_undo.c                       |   34 ++--
 gap/gap_thumbnail.c                        |    8 +-
 gap/gap_vex_dialog.c                       |   18 ++-
 gap/gap_video_index_creator.c              |    4 +-
 gap/gap_water_pattern.c                    |   17 +-
 gap/gap_wr_color_balance.c                 |    5 +-
 gap/gap_wr_color_curve.c                   |    6 +-
 gap/gap_wr_resynth.c                       |   16 +-
 gap/gap_wr_trans.c                         |   12 +-
 libgapbase/gap_base.c                      |    3 +-
 libgapbase/gap_timm.c                      |   21 +-
 libgapbase/gap_timm.h                      |    7 +-
 libgapbase/gap_val_file.c                  |    2 +-
 libgapvidapi/gap_vid_api.c                 |  125 +++++++----
 libgapvidapi/gap_vid_api_ffmpeg.c          |  277 ++++++++++++++-----------
 libgapvidapi/gap_vid_api_gimp.c            |   20 ++-
 libgapvidapi/gap_vid_api_mp_util.c         |   13 +-
 libgapvidapi/gap_vid_api_mpeg3.c           |   17 +-
 libgapvidapi/gap_vid_api_mpeg3toc.c        |   11 +-
 libgapvidapi/gap_vid_api_vidindex.c        |    2 +-
 libgapvidutil/gap_gve_raw.c                |    2 +-
 libgapvidutil/gap_gve_raw.h                |    7 +
 vid_common/gap_cme_callbacks.c             |    1 -
 vid_common/gap_cme_gui.c                   |   47 ++---
 vid_enc_avi/gap_enc_avi_gui.c              |    7 +-
 vid_enc_avi/gap_enc_avi_main.c             |   14 +-
 vid_enc_ffmpeg/gap_enc_ffmpeg_callbacks.c  |   45 +++-
 vid_enc_ffmpeg/gap_enc_ffmpeg_gui.c        |   22 +-
 vid_enc_ffmpeg/gap_enc_ffmpeg_main.c       |  318 ++++++++++++++--------------
 vid_enc_ffmpeg/gap_enc_ffmpeg_par.c        |   12 +-
 vid_enc_rawframes/gap_enc_rawframes_main.c |    6 +-
 vid_enc_single/gap_enc_singleframes_main.c |    9 -
 91 files changed, 1479 insertions(+), 1184 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 415b336..0d61a32 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,124 @@
+2014-05-21 Wolfgang Hofer <hof gimp org>
+
+- fixed bug at loading movepath settings from xml file
+  (load must not overwrite current and cached image_is's)
+
+- movepath disabled checks for too many controlpoints.
+    the old implementation refused rendering 
+    when the number of handled frames is less than the number of controlpoints.
+       Error: More controlpoints (%d) than handled frames (%d).
+       Error: Keyframe %d at point [%d] higher or equal than last handled frame
+    
+    now rendering is possible and the rest of controlpoints is ignored.
+
+- detailtracking 
+    fixed bug that captures invalid coordinates in case the path has only one point
+    (p_capture_2_vector_points)
+
+
+- fixed some typo's (according to patch by Anders Jonsson see #730034 and #730239 )
+
+- fixed a lot of compiler warnings. (most of them in debug logging printf calls..)
+
+ 
+   * gap/gap_accel_da.c
+   * gap/gap_arr_dialog.c
+   * gap/gap_audio_wav.c
+   * gap/gap_blend_fill_main.c
+   * gap/gap_colordiff.c 
+   * gap/gap_colormask_dialog.c
+   * gap/gap_colormask_exec.c
+   * gap/gap_colormask_file.c
+   * gap/gap_colormask_main.c
+   * gap/gap_dbbrowser_utils.c
+   * gap/gap_decode_mplayer_main.c
+   * gap/gap_detail_align_exec.c
+   * gap/gap_detail_tracking_exec.c
+   * gap/gap_detail_tracking_main.c
+   * gap/gap_edge_detection.c
+   * gap/gap_filter_iterators.c
+   * gap/gap_fire_pattern.c
+   * gap/gap_fmac_base.c
+   * gap/gap_fmac_context.c
+   * gap/gap_fmac_main.c
+   * gap/gap_fmac_varying_main.c
+   * gap/gap_frame_fetcher.c
+   * gap/gap_image.c
+   * gap/gap_layer_copy.c
+   * gap/gap_lib.c
+   * gap/gap_locate.c
+   * gap/gap_main.c
+   * gap/gap_mod_layer.c
+   * gap/gap_mod_layer_dialog.c
+   * gap/gap_morph_dialog.c
+   * gap/gap_morph_exec.c
+   * gap/gap_morph_shape.c   
+   * gap/gap_morph_tween_dialog.c  
+
+   * gap/gap_mov_dialog.c
+   * gap/gap_mov_exec.c [.h]
+   * gap/gap_mov_main.c
+   * gap/gap_mov_render.c
+   * gap/gap_mov_xml_par.c
+
+   * gap/gap_navigator_dialog.c
+   * gap/gap_onion_base.c
+   * gap/gap_onion_dialog.c
+   * gap/gap_onion_main.c   
+   * gap/gap_pdb_calls.c   
+   * gap/gap_pixelrgn.c
+   * gap/gap_player_cache.c
+   * gap/gap_player_dialog.c
+   * gap/gap_pview_da.c
+   * gap/gap_range_ops.c
+   * gap/gap_stock.c
+   * gap/gap_story_dialog.c
+   * gap/gap_story_file.c
+   * gap/gap_story_properties.c
+   * gap/gap_story_render_lossless.c
+   * gap/gap_story_render_processor.c  [.h]
+   * gap/gap_story_section_properties.c
+   * gap/gap_story_sox.c
+   * gap/gap_story_undo.c   
+   * gap/gap_thumbnail.c
+   * gap/gap_vex_dialog.c
+   * gap/gap_video_index_creator.c
+   * gap/gap_water_pattern.c
+   * gap/gap_wr_color_balance.c
+   * gap/gap_wr_color_curve.c
+   * gap/gap_wr_resynth.c
+   * gap/gap_wr_trans.c
+
+ 
+   * libgapbase/gap_base.c
+   * libgapbase/gap_timm.c [.h]
+   * libgapbase/gap_val_file.c
+ 
+   * libgapvidapi/gap_vid_api.c
+   * libgapvidapi/gap_vid_api_ffmpeg.c
+   * libgapvidapi/gap_vid_api_gimp.c 
+   * libgapvidapi/gap_vid_api_mp_util.c 
+   * libgapvidapi/gap_vid_api_mpeg3.c
+   * libgapvidapi/gap_vid_api_mpeg3toc.c
+   * libgapvidapi/vid_api_vidindex.c 
+ 
+   * libgapvidutil/gap_gve_raw.c [.h]
+
+   * vid_common/gap_cme_callbacks.c
+   * vid_common/gap_cme_gui.c
+
+   * vid_enc_avi/gap_enc_avi_gui.c
+   * vid_enc_avi/gap_enc_avi_main.c
+
+   * vid_enc_ffmpeg/gap_enc_ffmpeg_callbacks
+   * vid_enc_ffmpeg/gap_enc_ffmpeg_gui.c
+   * vid_enc_ffmpeg/gap_enc_ffmpeg_main.c
+   * vid_enc_ffmpeg/gap_enc_ffmpeg_par.c
+
+   * vid_enc_rawframes/gap_enc_rawframes_main.c
+   * vid_enc_single/gap_enc_singleframes_main.c
+   
+   
 2014-05-09 Wolfgang Hofer <hof gimp org>
 
 - provide additional video encoder preset file: ff_x264_aac_hq.preset
diff --git a/gap/gap_accel_da.c b/gap/gap_accel_da.c
index b95f58d..e1baa8d 100644
--- a/gap/gap_accel_da.c
+++ b/gap/gap_accel_da.c
@@ -238,7 +238,7 @@ p_accel_event_callback(GtkWidget *wgt, GdkEvent *event,
         {
           case 1:
             accel_wgt->isButton1Pressed = TRUE;
-            gtk_adjustment_set_value(accel_wgt->adj, 
p_calculate_accelCharacteristic_from_Position(accel_wgt));
+            gtk_adjustment_set_value(GTK_ADJUSTMENT(accel_wgt->adj), 
p_calculate_accelCharacteristic_from_Position(accel_wgt));
             break;
           case 2:
             gtk_adjustment_set_value(accel_wgt->adj, (gfloat)0.0);
diff --git a/gap/gap_arr_dialog.c b/gap/gap_arr_dialog.c
index d5cfc45..5578481 100644
--- a/gap/gap_arr_dialog.c
+++ b/gap/gap_arr_dialog.c
@@ -332,7 +332,7 @@ label_create_value(char *title, GtkTable *table, int row,
     else
     {
       /* the caller provided just the Label
-       * in this case we show the label (spread accross all columns)
+       * in this case we show the label (spread across all columns)
        */
      from_col = 0;
      label = gtk_label_new(title);
@@ -1280,7 +1280,7 @@ gint gap_arr_std_dialog(const char *title_txt,
   g_object_set_data (G_OBJECT (arrint_ptr->dlg), GAP_ARR_INTERFACE_PTR, (gpointer)arrint_ptr);
   gtk_window_set_title (GTK_WINDOW (arrint_ptr->dlg), title_txt);
 
-  // hof: on my Gnome windowmanger (openSUSE 11.11) pop ups created with gtk_dialog_new
+  // hof: on my Gnome windowmanager (openSUSE 11.11) pop ups created with gtk_dialog_new
   // often open BEHIND other windows.
   //
   // As workaround i commented out placing the pop up on mouse position
@@ -1906,7 +1906,7 @@ void gap_arr_msg_popup(GimpRunMode run_mode, const char *msg)
 /* --------------------------------------
  * p_mkdir_from_file_if_not_exists
  * --------------------------------------
- * return TRUE if directory part of the specifed filename already exists
+ * return TRUE if directory part of the specified filename already exists
  *             or did not exist, but could be created successfully.
  * return FALSE if directory part does not exist and could not be created.
  */
@@ -2103,7 +2103,7 @@ gap_arr_create_vindex_permission(const char *videofile, const char *vindex_file
   l_info_msg = g_strdup_printf(_("Do you want to create a videoindex file ?\n"
                               "\n"
                               "If you want GIMP-GAP to create videoindex files automatically\n"
-                              "when recommanded, whithout showing up this dialog again\n"
+                              "when recommended, without showing up this dialog again\n"
                               "then you should add the following line to\n"
                               "your gimprc file:\n"
                               "%s")
@@ -2127,13 +2127,13 @@ gap_arr_create_vindex_permission(const char *videofile, const char *vindex_file
   {
     case SEEK_STATUS_SEEKSUPP_NONE:
       l_status_info = g_strdup_printf(_("WARNING:\nrandom positioning is not possible for this video.\n"
-                                      "creating a video index is NOT recommanded\n"
+                                      "creating a video index is NOT recommended\n"
                                       "(would not work)\n"));
       break;
     case SEEK_STATUS_SEEKSUPP_VINDEX:
-      l_status_info = g_strdup_printf(_("TIP:\ncreating a video index on this video is recommanded.\n"
+      l_status_info = g_strdup_printf(_("TIP:\ncreating a video index on this video is recommended.\n"
                                       "This will enable fast and random frame access.\n"
-                                      "but requires one initial full scann.\n"
+                                      "but requires one initial full scan.\n"
                                       "(this will take a while).\n"));
       break;
     case SEEK_STATUS_SEEKSUPP_NATIVE:
@@ -2311,7 +2311,7 @@ gap_dialog_new_valist (const gchar    *title,
 
   if(help_id != NULL)
   {
-      GtkWidget *action_area = gtk_dialog_get_action_area (dlg);
+      GtkWidget *action_area = gtk_dialog_get_action_area (GTK_DIALOG(dlg));
       GtkWidget *help_button = gtk_button_new_from_stock (GTK_STOCK_HELP);
 
       g_object_set_data (G_OBJECT (help_button), "HelpFunc", (gpointer)help_func);
@@ -2344,7 +2344,7 @@ gap_dialog_new_valist (const gchar    *title,
  * has same signature as gimp_dialog_new
  * but forces creation with hint GDK_WINDOW_TYPE_HINT_NORMAL
  * to behave like normal toplevel window
- * (e.g. has default decoreations of the Window manager
+ * (that has default decoreations of the Window manager
  * typical close, maximize, minimize widgets
  * and shall open in front of other windows..)
  */
@@ -2371,10 +2371,10 @@ gap_dialog_new (const gchar    *title,
 
   if(gap_debug)
   {
-    printf("gap_dialog_new title:%s role:%s parent:%d flags:%d\n"
+    printf("gap_dialog_new title:%s role:%s parent:%ld flags:%d\n"
        ,title
        ,role
-       ,(int)parent
+       ,(long)parent
        ,(int)flags
        );
   }
@@ -2390,7 +2390,7 @@ gap_dialog_new (const gchar    *title,
 
   if(gap_debug)
   {
-    printf("gap_dialog_new DONE, dialog:%d\n", (int)dialog);
+    printf("gap_dialog_new DONE, dialog:%ld\n", (long)dialog);
   }
 
   return dialog;
diff --git a/gap/gap_audio_wav.c b/gap/gap_audio_wav.c
index 591981d..9483de3 100644
--- a/gap/gap_audio_wav.c
+++ b/gap/gap_audio_wav.c
@@ -161,7 +161,7 @@ gap_audio_wav_write_header(FILE *fp
 
   if(gap_debug)
   {
-    printf("gap_audio_wav_write_header: START fp:%d\n", (int)fp);
+    printf("gap_audio_wav_write_header: START fp:%ld\n", (long)fp);
   }
 
   l_data_len  = nsamples * bytes_per_sample;
@@ -189,7 +189,7 @@ gap_audio_wav_write_header(FILE *fp
   p_check_errno();
   if(gap_debug)
   {
-    printf("gap_audio_wav_write_header: DONE fp:%d\n", (int)fp);
+    printf("gap_audio_wav_write_header: DONE fp:%ld\n", (long)fp);
   }
 }  /* end gap_audio_wav_write_header */
 
diff --git a/gap/gap_blend_fill_main.c b/gap/gap_blend_fill_main.c
index a054767..98e9af7 100644
--- a/gap/gap_blend_fill_main.c
+++ b/gap/gap_blend_fill_main.c
@@ -462,7 +462,7 @@ p_progress_init(FilterContext *context)
     areaPixels = context->workLayerWidth * context->workLayerHeight;
     context->progressStepsDone = 0.0;
 
-    /* progress steps e.g. pixels to be handled for creating the work layer */
+    /* progress steps i.e. pixels to be handled for creating the work layer */
     context->progressStepsTotal = areaPixels;
 
     if (context->valPtr->horizontalBlendFlag)
@@ -1006,13 +1006,13 @@ p_set_selection_from_vectors_string(FilterContext *context)
 
   if ((vectorsOk) && (vectors_ids != NULL) && (num_vectors > 0))
   {
-    gboolean       selOk;
+    /* gboolean       selOk; */
     gint32         vectorId;
     GimpChannelOps operation;
 
     vectorId = vectors_ids[0];
     operation = GIMP_CHANNEL_OP_REPLACE;
-    selOk = gimp_vectors_to_selection(vectorId
+    /* selOk = */ gimp_vectors_to_selection(vectorId
                                      , operation
                                      , FALSE      /*  antialias */
                                      , FALSE      /*  feather   */
@@ -1059,13 +1059,13 @@ p_set_selection_from_vectors_file(FilterContext *context)
 
   if ((vectorsOk) && (vectors_ids != NULL) && (num_vectors > 0))
   {
-    gboolean       selOk;
+    /* gboolean       selOk; */
     gint32         vectorId;
     GimpChannelOps operation;
 
     vectorId = vectors_ids[0];
     operation = GIMP_CHANNEL_OP_REPLACE;
-    selOk = gimp_vectors_to_selection(vectorId
+    /* selOk =  */ gimp_vectors_to_selection(vectorId
                                      , operation
                                      , FALSE      /*  antialias */
                                      , FALSE      /*  feather   */
@@ -1179,6 +1179,10 @@ p_create_workLayer(FilterContext *context)
       printf("creating altSelection: %d\n", (int)context->valPtr->altSelection);
     }
     altSelection_success = p_set_altSelection(context);
+    if(gap_debug)
+    {
+      printf("after creating altSelection_success: %d\n", (int)altSelection_success);
+    }
   }
 
   if(context->valPtr->altSelection == SELECTION_FROM_VECTORS)
@@ -1227,7 +1231,7 @@ p_create_workLayer(FilterContext *context)
 
   if(gap_debug)
   {
-    printf("intersect ix:%d iy:%d iWidth:%d iHeight:%d  ix1:%d iy1:%d ix2:%d iy2:%d\n"
+    printf("intersect ix:%d iy:%d iWidth:%d iHeight:%d  ix1:%d iy1:%d ix2:%d iy2:%d has_sel:%d\n"
        ,(int)ix
        ,(int)iy
        ,(int)iWidth
@@ -1236,6 +1240,7 @@ p_create_workLayer(FilterContext *context)
        ,(int)iy1
        ,(int)ix2
        ,(int)iy2
+       ,(int)has_selection
        );
     printf("workLayerOffsX:%d workLayerOffsY:%d workLayerWidth:%d workLayerHeight:%d\n"
        ,(int)context->workLayerOffsX
@@ -1452,8 +1457,8 @@ p_check_exec_condition_and_set_ok_sesitivity(GuiStuff *guiStuffPtr)
       {
         gchar *msg;
 
-        msg = g_strdup_printf(_("Path Vectors too large to fit into buffersize:%d.")
-                              , sizeof(guiStuffPtr->valPtr->selectionSVGFileName));
+        msg = g_strdup_printf(_("Path Vectors too large to fit into buffersize:%ld.")
+                              , (long)sizeof(guiStuffPtr->valPtr->selectionSVGFileName));
         gtk_label_set_text(GTK_LABEL(guiStuffPtr->msg_label), msg);
         g_free(msg);
         okButtonSensitive = FALSE;
@@ -1512,8 +1517,8 @@ p_selectionComboCallback (GtkWidget *widget, gint32 *layerId)
 
   if(gap_debug)
   {
-    printf("p_selectionComboCallback: LayerAddr:%d value:%d\n"
-      ,(int)layerId
+    printf("p_selectionComboCallback: LayerAddr:%ld value:%d\n"
+      ,(long)layerId
       ,(int)value
       );
   }
@@ -1754,8 +1759,8 @@ p_save_vectors_to_string(GuiStuff *guiStuffPtr)
     }
     else
     {
-        g_message(_("Path Vectors too large to fit into buffersize:%d.")
-                 , sizeof(guiStuffPtr->valPtr->selectionSVGFileName));
+        g_message(_("Path Vectors too large to fit into buffersize:%ld.")
+                 , (long)sizeof(guiStuffPtr->valPtr->selectionSVGFileName));
     }
     g_free(svgString);
   }
diff --git a/gap/gap_colordiff.c b/gap/gap_colordiff.c
index 41154c9..f827660 100644
--- a/gap/gap_colordiff.c
+++ b/gap/gap_colordiff.c
@@ -46,20 +46,20 @@ extern      int gap_debug; /* ==0  ... dont print debug infos */
 
 
 
-static long p_gdouble_to_long(gdouble value)
-{
-  long lval;
-  
-  lval = value * TO_LONG_FACTOR;
-  return (lval);
-}
-static gdouble p_long_to_gdouble(long value)
-{
-  gdouble dval;
-  
-  dval = (gdouble)value / TO_GDOUDBLE_FACTOR;
-  return (dval);
-}
+// static long p_gdouble_to_long(gdouble value)
+// {
+//   long lval;
+//   
+//   lval = value * TO_LONG_FACTOR;
+//   return (lval);
+// }
+// static gdouble p_long_to_gdouble(long value)
+// {
+//   gdouble dval;
+//   
+//   dval = (gdouble)value / TO_GDOUDBLE_FACTOR;
+//   return (dval);
+// }
 
 
 
diff --git a/gap/gap_colormask_dialog.c b/gap/gap_colormask_dialog.c
index 005af4a..d933847 100644
--- a/gap/gap_colormask_dialog.c
+++ b/gap/gap_colormask_dialog.c
@@ -94,7 +94,7 @@ typedef struct {
   GimpPixelRgn       src_rgn;
   GimpPixelRgn       colormask_rgn;
 
-  GimpPreview       *preview;
+  GtkWidget         *preview;
   gboolean           applyImmediate;
   GapColormaskValues *cmaskvalsPtr;
 
@@ -157,18 +157,18 @@ static void     dialog_update_preview      (GimpPreview   *preview);
 static gint     dialog_preview_events      (GtkWidget     *area,
                                             GdkEvent      *event,
                                             GimpPreview   *preview);
-static void     dialog_get_rows            (GimpPixelRgn  *pr,
-                                            guchar       **rows,
-                                            gint           x,
-                                            gint           y,
-                                            gint           width,
-                                            gint           height);
-static void     dialog_fill_src_rows       (gint           start,
-                                            gint           how_many,
-                                            gint           yofs);
-static void     dialog_fill_bumpmap_rows   (gint           start,
-                                            gint           how_many,
-                                            gint           yofs);
+// static void     dialog_get_rows            (GimpPixelRgn  *pr,
+//                                             guchar       **rows,
+//                                             gint           x,
+//                                             gint           y,
+//                                             gint           width,
+//                                             gint           height);
+//static void     dialog_fill_src_rows       (gint           start,
+//                                            gint           how_many,
+//                                            gint           yofs);
+// static void     dialog_fill_bumpmap_rows   (gint           start,
+//                                             gint           how_many,
+//                                             gint           yofs);
 static gint     dialog_constrain           (gint32         image_id,
                                             gint32         drawable_id,
                                             gpointer       data);
@@ -391,7 +391,7 @@ p_create_filter_options(GapColormaskValues *cmaskvals, GtkWidget *preview)
                               TRUE, 0, 0,
                               _("Isle Area size in pixels. "
                                 "small isolated opaque or transparent pixel areas below that size "
-                                "are removed (e.g toggled from opaque to transparent and vice versa)"),
+                                "are removed (i.e. toggled from opaque to transparent and vice versa)"),
                               NULL);
   g_signal_connect (adj, "value-changed",
                     G_CALLBACK (gimp_double_adjustment_update),
@@ -436,8 +436,6 @@ p_create_opacity_options(GapColormaskValues *cmaskvals, GtkWidget *preview)
   GtkWidget *frame;
   GtkWidget *vbox;
   GtkWidget *table;
-  GtkWidget *button;
-  GtkWidget *label;
   GtkObject *adj;
   gint       row = 0;
 
@@ -506,7 +504,7 @@ p_create_opacity_options(GapColormaskValues *cmaskvals, GtkWidget *preview)
                               _("Trigger alpha is only relevant in case the color mask has an alpha channel. 
"
                                 "All pixels where the alpha channel of the corresponding pixel "
                                 "in the color mask is below this trigger value "
-                                "are not changed (e.g. keep their original opacity)"),
+                                "are not changed (i.e. keep their original opacity)"),
                               NULL);
   g_signal_connect (adj, "value-changed",
                     G_CALLBACK (gimp_double_adjustment_update),
@@ -1378,11 +1376,11 @@ p_dialog_new_colormask (gboolean init_offsets)
 static void
 dialog_update_preview (GimpPreview *preview)
 {
-   guchar *dest_row;
-   gint    y;
+//   guchar *dest_row;
+//   gint    y;
    gint    x1, y1;
-   gint    width, height;
-   gint    bytes;
+//   gint    width, height;
+//   gint    bytes;
  
    gimp_preview_get_position (preview, &x1, &y1);
 
@@ -1684,7 +1682,6 @@ gap_colormask_create_dialog (GapColormaskValues *cmaskvals)
   GtkWidget *vbox;
   GtkWidget *preview;
   GtkWidget *frame;
-  GtkObject *adj;
 
   gimp_ui_init (PLUG_IN_BINARY, TRUE);
 
diff --git a/gap/gap_colormask_exec.c b/gap/gap_colormask_exec.c
index dd20c12..b88a114 100644
--- a/gap/gap_colormask_exec.c
+++ b/gap/gap_colormask_exec.c
@@ -251,8 +251,6 @@ static guchar        p_check_significant_changes_in_one_direction(GapColorMaskPa
 
 static inline void   p_check_avg_add_one_pixel(GapColorMaskParams *cmaskParPtr, gint xx, gint yy    // 
DEPRECATED
                            , gdouble *sumNbColorDiff, gdouble *countNbPixels);
-static gdouble       p_check_avg_diff_within_radius(GapColorMaskParams *cmaskParPtr, gint radius    // 
DEPRECATED
-                           , gdouble *sumNbColorDiff, gdouble *countNbPixels);
 
 
 static void          p_init_colordiffTable (const GimpPixelRgn *maskPR
@@ -1658,7 +1656,7 @@ p_is_isolated_pixel(GapColorMaskParams *cmaskParPtr, guchar currentAlpha)
  * p_isle_check_and_mark_nb_pixel
  * --------------------------------------------
  * checks if the specified neighbor pixel at coords nx, ny
- * has same opacity value as refOpacity (e.g the same opacity as the seed pixel).
+ * has same opacity value as refOpacity (that is the same opacity as the seed pixel).
  * If this is the case increment pixel count and
  * and add nx/ny to the point list (to initiate check of further neighbour pixels)
  *
@@ -1946,7 +1944,7 @@ p_remove_isolated_pixels(guchar currentAlpha, GapColorMaskParams *cmaskParPtr)
 /* ------------------------------------------
  * p_remove_isolates_pixels_rgn_render_region
  * ------------------------------------------
- * remove isolated pixels (e.g. areas smaller than isleRadius)
+ * remove isolated pixels (all areas smaller than isleRadius)
  * from the layermask
  * Note that protected pixels (that are transparent in the colormask)
  * are not affected.
@@ -2144,7 +2142,7 @@ p_colormask_avg_rgn_render_region (const GimpPixelRgn *maskPR
       if (isPixelProtected)
       {
         /* protected pixels are set full opaque in the layermask
-         * (e.g. they keep their original opacity when layermask is applied)
+         * (so they keep their original opacity when layermask is applied)
          */
         lmsk[idxLmsk] = 255;
         if(cmaskParPtr->debugCoordinate)
@@ -2383,11 +2381,11 @@ p_check_range_neighbour_sum(GapColorMaskParams *cmaskParPtr, gint dx, gint dy, g
 
     if (cmaskParPtr->debugCoordinate)
     {
-      printf("CHK xx:%d yy:%d countNbPixels:%.1f cmaskParPtr:%d hiColorThreshold:%.4f colordiffTab:%.4f\n"
+      printf("CHK xx:%d yy:%d countNbPixels:%.1f cmaskParPtr:%ld hiColorThreshold:%.4f colordiffTab:%.4f\n"
         , (int)xx
         , (int)yy
         , *countNbPixels
-        , (int)cmaskParPtr
+        , (long)cmaskParPtr
         , (float)cmaskParPtr->hiColorThreshold
         , (float)cmaskParPtr->colordiffTable[iTab]
         );
@@ -2819,7 +2817,7 @@ p_calculate_clip_area_average_values(GapColorMaskParams *cmaskParPtr)
  *   check average colordiff of neighbor pixels
  *   in upper, lower, left and right direction.
  *   in case the average colordiff is below the threshold
- *   return TRUE (e.g. the pixel is considered as matching good enough
+ *   return TRUE (i.e. the pixel is considered as matching good enough
  *   with the colormask)
  *   Otherwise return FALSE.
  *   This algorithm is also used as fallback strategy
@@ -2832,7 +2830,7 @@ p_check_average_colordiff_incl_neighbours(GapColorMaskParams *cmaskParPtr)
   gdouble countNbPixels;
   gdouble avgColordiff[4];
 
-  gint32 iTab;
+  //gint32 iTab;
 
   if ((cmaskParPtr->algorithm == GAP_COLORMASK_ALGO_AVG_CHANGE_1)
   || (cmaskParPtr->algorithm == GAP_COLORMASK_ALGO_AVG_CHANGE_2))
@@ -3719,7 +3717,7 @@ p_mix_newmask_rgn_render(const GimpPixelRgn *pmskPR
   guchar*  pmsk = pmskPR->data;   /* the colormask from previous frame  */
   guchar*  mask = maskPR->data;   /* the initial reference colormask */
   guchar*  orig = origPR->data;   /* the current frame original */
-  guchar*  work = workPR->data;   /* the destination drawable (e.g. new colormask) */
+  guchar*  work = workPR->data;   /* the destination drawable (i.e. new colormask) */
 
 
   for (row = 0; row < workPR->h; row++)
@@ -4074,7 +4072,7 @@ p_copy_cmaskvals_to_colorMaskParams(GapColormaskValues *cmaskvals, GapColorMaskP
  * handles transparency by applying a color image (RGB) or (RGBA) as mask,
  * The pixels that are transparent (below or equal triggerAlpha) in
  * the alpha channel of the colormask are considered as PROTECTED
- * e.g are not affected by this filter.
+ * i.e. are not affected by this filter.
  * (those pixels keep their original alpha channel)
  *
  * The resulting transparency is generated as new layermask
@@ -4126,7 +4124,7 @@ gap_colormask_apply_to_layer_of_same_size (gint32 dst_layer_id
            "  DST: width:%d height: %d  BPP:%d \n"
            "  MSK: width:%d height: %d  BPP:%d \n"
            "  triggerAlpha:%d lowerAlpha:%d upperAlpha:%d algorithm:%d loColorThreshold:%f\n"
-           "  cmaskParPtr:%d  hiColorThreshold: %f\n"
+           "  cmaskParPtr:%ld  hiColorThreshold: %f\n"
           , (int)dst_drawable->width
           , (int)dst_drawable->height
           , (int)dst_drawable->bpp
@@ -4138,7 +4136,7 @@ gap_colormask_apply_to_layer_of_same_size (gint32 dst_layer_id
           , (int)cmaskParPtr->upperAlpha255
           , (int)cmaskParPtr->algorithm
           , (float)cmaskParPtr->loColorThreshold
-          , (int)cmaskParPtr
+          , (long)cmaskParPtr
           , (float)cmaskParPtr->hiColorThreshold
           );
   }
@@ -4607,7 +4605,7 @@ gap_create_or_replace_colormask_layer (gint32 orig_layer_id
 
   if(prevCmaskId != cmaskParPtr->cmask_drawable_id)
   {
-    /* delete (e.g. close) the previous frame image (form memory not from disk)
+    /* delete (i.e. close) the previous frame image (form memory not from disk)
      */
     gap_image_delete_immediate(gimp_item_get_image(prevCmaskId));
   }
@@ -4646,5 +4644,3 @@ gap_colormask_apply_by_name (gint32 dst_layer_id
                           ));
 
 }  /* end gap_colormask_apply_by_name */
-
-
diff --git a/gap/gap_colormask_file.c b/gap/gap_colormask_file.c
index 8a92fe7..0eb479e 100644
--- a/gap/gap_colormask_file.c
+++ b/gap/gap_colormask_file.c
@@ -104,8 +104,8 @@ gap_colormask_file_load (const char *filename, GapColormaskValues *cmaskvals)
 
   //if(gap_debug)
   {
-    printf("gap_colormask_file_load: params loaded: cmaskvals:%d cnt_scanned_items:%d\n"
-       , (int)cmaskvals
+    printf("gap_colormask_file_load: params loaded: cmaskvals:%ld cnt_scanned_items:%d\n"
+       , (long)cmaskvals
        , (int)cnt_scanned_items
        );
   }
@@ -163,4 +163,3 @@ gap_colormask_file_save (const char *filename, GapColormaskValues *cmaskvals)
 
   return(TRUE);
 }  /* end gap_colormask_file_save */
-
diff --git a/gap/gap_colormask_main.c b/gap/gap_colormask_main.c
index 009ad1d..0cae526 100644
--- a/gap/gap_colormask_main.c
+++ b/gap/gap_colormask_main.c
@@ -214,7 +214,7 @@ static void query (void)
                           "Note that the colormask drawable may have an alpha channel."
                           "in this case the transparent parts of the colormask are protected areas, "
                           "that are not affected by this filter. "
-                          "(e.g the corresponding pixels in processed layer keep their original opacity) "
+                          "(i.e. the corresponding pixels in processed layer keep their original opacity) "
                           " ",
                           PLUG_IN_AUTHOR,
                           PLUG_IN_COPYRIGHT,
@@ -462,6 +462,3 @@ p_colormask_apply_run (gint32 image_id, gint32 drawable_id, gboolean doProgress,
   return (retLayerId);
 }       /* end p_colormask_apply_run */
 
-
-
-
diff --git a/gap/gap_dbbrowser_utils.c b/gap/gap_dbbrowser_utils.c
index afdd283..f77535b 100644
--- a/gap/gap_dbbrowser_utils.c
+++ b/gap/gap_dbbrowser_utils.c
@@ -1110,11 +1110,11 @@ gap_db_get_plugin_menupath (const gchar *search_text)
   static gboolean initialized = FALSE;
   gint nreturn_vals;
   gchar **menu_strs;
-  gchar **accel_strs;
-  gchar **prog_strs;
-  gchar **types_strs;
+  /* gchar **accel_strs; */
+  /* gchar **prog_strs;  */
+  /* gchar **types_strs; */
   gchar **realname_strs;
-  gint  *time_ints;
+  /* gint  *time_ints; */
 
   gchar *menu_path;
 
@@ -1142,14 +1142,14 @@ gap_db_get_plugin_menupath (const gchar *search_text)
   if (initialized)
     {
       int loop;
-      int num_plugins;
+      /* int num_plugins; */
 
-      num_plugins        = return_vals[1].data.d_int32;
+      /* num_plugins        = return_vals[1].data.d_int32; */
       menu_strs          = return_vals[2].data.d_stringarray;
-      accel_strs         = return_vals[4].data.d_stringarray;
-      prog_strs          = return_vals[6].data.d_stringarray;
-      types_strs         = return_vals[8].data.d_stringarray;
-      time_ints          = return_vals[10].data.d_int32array;
+      /* accel_strs       = return_vals[4].data.d_stringarray; */
+      /* prog_strs          = return_vals[6].data.d_stringarray; */
+      /* types_strs         = return_vals[8].data.d_stringarray; */
+      /* time_ints          = return_vals[10].data.d_int32array; */
       realname_strs      = return_vals[12].data.d_stringarray;
 
 
diff --git a/gap/gap_decode_mplayer_main.c b/gap/gap_decode_mplayer_main.c
index 63662c8..d308211 100644
--- a/gap/gap_decode_mplayer_main.c
+++ b/gap/gap_decode_mplayer_main.c
@@ -154,19 +154,14 @@ static void run(const gchar *name
 {
   const char *l_env;
   
-  char        l_extension[32];
   static GimpParam values[2];
   GimpRunMode run_mode;
   GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  gint32     image_id;
-  gint32     lock_image_id;
-  gint32     nr;
    
   gint32     l_rc;
 
   *nreturn_vals = 1;
   *return_vals = values;
-  nr = 0;
   l_rc = 0;
 
   INIT_I18N ();
@@ -178,8 +173,6 @@ static void run(const gchar *name
   }
 
   run_mode = param[0].data.d_int32;
-  image_id = -1;
-  lock_image_id = image_id;
 
   if(gap_debug) fprintf(stderr, "\n\ngap_main: debug name = %s\n", name);
 
diff --git a/gap/gap_detail_align_exec.c b/gap/gap_detail_align_exec.c
index b024505..4958eb0 100644
--- a/gap/gap_detail_align_exec.c
+++ b/gap/gap_detail_align_exec.c
@@ -919,9 +919,9 @@ p_refresh_and_update_infoLabel(GtkWidget *widgetDummy, AlignDialogVals *advPtr)
 
   if(gap_debug)
   {
-    printf("p_refresh_and_update_infoLabel widgetDummy:%d advPtr:%d\n"
-          , (int) widgetDummy
-          , (int) advPtr
+    printf("p_refresh_and_update_infoLabel widgetDummy:%ld advPtr:%ld\n"
+          , (long) widgetDummy
+          , (long) advPtr
           );
   }
 
@@ -1304,5 +1304,3 @@ gap_detail_exact_align_via_4point_path(gint32 image_id, gint32 activeDrawableId
   
   
 }  /* end  gap_detail_exact_align_via_4point_path */
-
-
diff --git a/gap/gap_detail_tracking_exec.c b/gap/gap_detail_tracking_exec.c
index e797cfa..6f7b34d 100644
--- a/gap/gap_detail_tracking_exec.c
+++ b/gap/gap_detail_tracking_exec.c
@@ -240,9 +240,12 @@ p_capture_2_vector_points(gint32 imageId, PixelCoords *coordPtr, PixelCoords *co
 
     if((gx2 != gx1) || (gy2 != gy1))
     {
-      coordPtr2->px = gx2;
-      coordPtr2->py = gy2;
-      coordPtr2->valid = TRUE;
+      if ((gx2 >= 0) && (gy2 >= 0))
+      {
+        coordPtr2->px = gx2;
+        coordPtr2->py = gy2;
+        coordPtr2->valid = TRUE;
+      }
     }
 
   }
@@ -893,7 +896,7 @@ static void
 p_set_2_vector_points(gint32 imageId, PixelCoords *targetCoords, PixelCoords *targetCoords2)
 {
   gint32  activeVectorsId;
-  gint    newStrokeId;
+  /* gint    newStrokeId; */
 
   gdouble  *points;
   gint      num_points;
@@ -952,7 +955,7 @@ p_set_2_vector_points(gint32 imageId, PixelCoords *targetCoords, PixelCoords *ta
       }
 
       type = GIMP_VECTORS_STROKE_TYPE_BEZIER;
-      newStrokeId = gimp_vectors_stroke_new_from_points (activeVectorsId
+      /* newStrokeId = */ gimp_vectors_stroke_new_from_points (activeVectorsId
                                      , type
                                      , num_points
                                      , points
@@ -1099,7 +1102,7 @@ gap_track_detail_on_top_layers(gint32 imageId, gboolean doProgress, FilterValues
         /* locate shall start investigations at matching coordinates of the previous processed frame
          * because the chance to find the detail near this postion is much greater than near
          * the start coords in the initial frame.
-         * (note that locate does use the initial frame e.g. the BG layer in this mode,
+         * (note that locate does use the initial frame i.e. the BG layer in this mode,
          * but without the locateOffsets we might loose track of the detail when it moves outside the 
targetRadius
          * and increasing the targetRadius would also result in siginificant longer processing time)
          */
@@ -1527,4 +1530,3 @@ gap_detail_tracking_dialog_cfg_set_vals(gint32 image_id)
   return(rc);
 
 }  /* end gap_detail_tracking_dialog_cfg_set_vals */
-
diff --git a/gap/gap_detail_tracking_main.c b/gap/gap_detail_tracking_main.c
index dde56aa..8411a28 100644
--- a/gap/gap_detail_tracking_main.c
+++ b/gap/gap_detail_tracking_main.c
@@ -117,7 +117,7 @@ static const GimpParamDef in_args[] =
     { GIMP_PDB_FLOAT,    "loacteColodiffThreshold",     "0.0 upto 1.0 threshold that defines tolerated 
average colordiff for successful detail tracking."
                                                         " ." },
     { GIMP_PDB_INT32,    "coordsRelToFrame1",    "1 .. substract coords of initial position from all 
recorded positions."
-                                                 "     (e.g. recording starts with px=0 py=0) "
+                                                 "     (i.e. recording starts with px=0 py=0) "
                                                  "0 .. record absolute positions" },
     { GIMP_PDB_INT32,    "offsX",                "fix X offset (is added to all recorded positions)" },
     { GIMP_PDB_INT32,    "offsY",                "fix Y offset (is added to all recorded positions)" },
@@ -138,7 +138,7 @@ static const GimpParamDef in_xml_args[] =
     { GIMP_PDB_INT32,    "run-mode",      "Interactive, non-interactive" },
     { GIMP_PDB_IMAGE,    "image",         "Input image"                  },
     { GIMP_PDB_DRAWABLE, "drawable",      "layer to be aligned"               },
-    { GIMP_PDB_INT32,    "framePhase",    "frame number e.g. phase to render (1 upto n recorded points in 
the xml file)." },
+    { GIMP_PDB_INT32,    "framePhase",    "frame number i.e. phase to render (1 upto n recorded points in 
the xml file)." },
     { GIMP_PDB_STRING,   "moveLogFile",          "optional name of a move path controlpoint xml file. (use - 
to write to stdout) " }
 };
 
@@ -489,9 +489,10 @@ runXmlAlign (const gchar *name,  /* name of plugin */
         if(gap_debug)
         {
           // TODO never saw this in tests ...
-          printf("animCallInfo.total_steps: %d current_step:%f\n"
+          printf("animCallInfo.total_steps: %d current_step:%f doProgress:%d\n"
             ,(int)animCallInfo.total_steps
             ,(float)animCallInfo.current_step
+            ,(int)doProgress
             );
         }
         if(xaVals.framePhase == 1)
@@ -551,7 +552,6 @@ run (const gchar *name,          /* name of plugin */
 {
   const gchar *l_env;
   gint32       image_id = -1;
-  gint32       activeDrawableId = -1;
   gboolean doProgress;
   gboolean doFlush;
   GapLastvalAnimatedCallInfo  animCallInfo;
@@ -611,7 +611,6 @@ run (const gchar *name,          /* name of plugin */
 
   /* get image and drawable */
   image_id = param[1].data.d_int32;
-  activeDrawableId = param[2].data.d_drawable;
 
 
   /* how are we running today? */
@@ -735,4 +734,3 @@ run (const gchar *name,          /* name of plugin */
   values[0].data.d_status = status;
 
 }       /* end run */
-
diff --git a/gap/gap_edge_detection.c b/gap/gap_edge_detection.c
index cc6994f..a7e0ce5 100644
--- a/gap/gap_edge_detection.c
+++ b/gap/gap_edge_detection.c
@@ -650,13 +650,13 @@ gint32 gap_edgeDetection(gint32  refDrawableId
    gpointer  pr;
    gdouble   threshold01f;
    gdouble   threshold255f;
-   gint      threshold255;
+   //gint      threshold255;
    gint      cx;
    gint      cy;
    
    threshold01f = CLAMP((threshold / 100.0), 0, 1);
    threshold255f = 255.0 * threshold01f;
-   threshold255 = threshold255f;
+   //threshold255 = threshold255f;
 
    p_get_debug_coords_from_guides(image_id, &cx, &cy);
    
@@ -743,7 +743,7 @@ gint32 gap_edgeDetection(gint32  refDrawableId
    , gdouble threshold, gint32 shift, gboolean doLevelsAutostretch
    , gboolean invert)
  {
-   gint32 blurLayerId;
+   //gint32 blurLayerId;
    gint32 edgeLayerId;
    gint32 imageId;
    GimpDrawable *edgeDrawable;
@@ -801,4 +801,3 @@ gint32 gap_edgeDetection(gint32  refDrawableId
    
  }  /* end gap_edgeDetectionByBlurDiff */
  
- 
diff --git a/gap/gap_filter_iterators.c b/gap/gap_filter_iterators.c
index 58033b5..ee50cb8 100644
--- a/gap/gap_filter_iterators.c
+++ b/gap/gap_filter_iterators.c
@@ -376,7 +376,7 @@ static void p_delta_gint_color(t_gint_color *val, t_gint_color *val_from, t_gint
  * via loading an image, or fetching a video frame.
  * In this case, the drawables (gint32 val_from and val_to) are expected to refere
  * to persistent Ids
- * e.g. are >= GAP_FMCT_MIN_PERSISTENT_DRAWABLE_ID
+ * i.e. are >= GAP_FMCT_MIN_PERSISTENT_DRAWABLE_ID
  * The image_ids of all fetched images are added to a list of last recent temp images
  * this list has to be deleted at end of filtermacro processing. if the list contains
  * more than NNNNN entries, the oldest entries are deleted at begin of a new fetch
@@ -653,7 +653,7 @@ p_capture_image_name_and_assign_pesistent_id(GapFmacContext *fmacContext, gint32
                                  , track
                                  , drawable_id
                                  , filename
-                                 , FALSE           /* force_id NO (e.g generate unique id) */
+                                 , FALSE           /* force_id NO (i.e. generate unique id) */
                                  , fmacContext
                                  );
     g_free(filename);
diff --git a/gap/gap_fire_pattern.c b/gap/gap_fire_pattern.c
index 069f8cd..0992eaf 100644
--- a/gap/gap_fire_pattern.c
+++ b/gap/gap_fire_pattern.c
@@ -331,12 +331,12 @@ p_init_cuvals(firepattern_val_t *cuvals)
  * p_caclulate_trapezoid_blend
  * --------------------------------------
  * calculate opacity blend factor (in the range 0.0 for fully black
- * upto 1.0 for keep full original colorchannel e.g. white) for the specified coordinate px/py
+ * upto 1.0 for keep full original colorchannel i.e. white) for the specified coordinate px/py
  * Coordinates within the trapezoid shape return value 1.0
- * Coorinates left or right outside the shape will result 1.0 > value > 0 (e.g. a shade of gray value)
+ * Coorinates left or right outside the shape will result 1.0 > value > 0 (i.e. a shade of gray value)
  * depending on their distance to the tapezoid core shape.
  * Coordinates where distance is greater than the flameBorder will return 0.0.
- * Note that Coordinates above flameHeight immediate switch to full black (e.g. 0.0)
+ * Note that Coordinates above flameHeight immediate switch to full black (i.e. 0.0)
  * because the processed fire shape layer is already initally filled with a soft vertical blend
  * from white at the base line to black at flame height.
  */                          
@@ -380,7 +380,7 @@ p_caclulate_trapezoid_blend(gint32 px, gint32 py, firepattern_val_t *cuvals, fir
   
   if(borderDistance > borderWidth)
   {
-    /* keep full original colorchannel e.g. white for pixel within the trapezoid core area */
+    /* keep full original colorchannel i.e. white for pixel within the trapezoid core area */
     return (1.0);
   }
   
@@ -1301,23 +1301,24 @@ on_blend_radio_callback(GtkWidget *wgt, gpointer user_data)
 static void
 p_update_widget_sensitivity (FirePatternDialog *wcd)
 {
-  gboolean inverseCreateImage;
+  //gboolean inverseCreateImage;
   gboolean inversecreateNewPattern;
   gboolean inverseForceShape;
   
   
   /* createImage dependent widgets */  
-  if(wcd->vals->createImage)
-  {
-    inverseCreateImage = FALSE;
-  }
-  else
-  {
-    inverseCreateImage = TRUE;
-  }
-  gtk_widget_set_sensitive(wcd->nframes_spinbutton ,          wcd->vals->createImage);
+  //if(wcd->vals->createImage)
+  //{
+  //  inverseCreateImage = FALSE;
+  //}
+  //else
+  //{
+  //  inverseCreateImage = TRUE;
+  //}
   //gtk_widget_set_sensitive(wcd->shiftPhaseY_spinbutton ,      inverseCreateImage);
 
+  gtk_widget_set_sensitive(wcd->nframes_spinbutton ,          wcd->vals->createImage);
+
   /* createNewPattern dependent widgets */  
   if(wcd->createNewPattern)
   {
@@ -1579,8 +1580,8 @@ p_cloud_layer_menu_callback(GtkWidget *widget, gint32 *cloudLayerId)
 
   if(gap_debug)
   {
-    printf("p_cloud_layer_menu_callback: cloudLayerAddr:%d value:%d\n"
-      ,(int)cloudLayerId
+    printf("p_cloud_layer_menu_callback: cloudLayerAddr:%ld value:%d\n"
+      ,(long)cloudLayerId
       ,(int)value
       );
   }
@@ -1600,16 +1601,19 @@ p_cloud_layer_menu_callback(GtkWidget *widget, gint32 *cloudLayerId)
  * 
  */
 static gint
-p_pattern_layer_constrain(gint32 image_id, gint32 drawable_id, FirePatternDialog *wcd)
+p_pattern_layer_constrain(gint32 image_id, gint32 drawable_id, gpointer data)
 {
   gint32 processedImageId;
+  FirePatternDialog *wcd;
+  
+  wcd = (FirePatternDialog *)data;
 
   if(gap_debug)
   {
-    printf("p_pattern_layer_constrain PROCEDURE image_id:%d drawable_id:%d wcd:%d\n"
+    printf("p_pattern_layer_constrain PROCEDURE image_id:%d drawable_id:%d wcd:%ld\n"
                           ,(int)image_id
                           ,(int)drawable_id
-                          ,(int)wcd
+                          ,(long)wcd
                           );
   }
 
@@ -1671,7 +1675,6 @@ do_dialog (FirePatternDialog *wcd, firepattern_val_t *cuvals)
   GtkWidget *dialog_action_area1;
   GtkWidget *checkbutton;
   GtkWidget *combo;
-  gint       countClouds;
   gint       row;
 
 
@@ -2559,8 +2562,6 @@ run(const gchar *name
 
   gint32    l_image_id = -1;
   gint32    l_drawable_id = -1;
-  gint32    l_handled_drawable_id = -1;
-
 
 
   /* Get the runmode from the in-parameters */
@@ -2696,7 +2697,6 @@ run(const gchar *name
         
         gimp_image_undo_group_start (l_image_id);
         success = p_run_renderFirePattern(l_drawable_id, &l_cuvals, ctxt);
-        l_handled_drawable_id = l_drawable_id;
         gimp_image_undo_group_end (l_image_id);
         
         if(success)
diff --git a/gap/gap_fmac_base.c b/gap/gap_fmac_base.c
index ccbeb0e..8c164f4 100644
--- a/gap/gap_fmac_base.c
+++ b/gap/gap_fmac_base.c
@@ -217,16 +217,16 @@ p_scan_fmac_line(GapValTextFileLines *txf_ptr, GimpRunMode run_mode, const char
   {
      if(fmac_line)
      {
-       printf("p_scan_fmac_line: END fmac_line:%d filtername:%s paramlength:%d\n"
-              , (int)fmac_line
+       printf("p_scan_fmac_line: END fmac_line:%ld filtername:%s paramlength:%d\n"
+              , (long)fmac_line
               , fmac_line->filtername
               , (int)fmac_line->paramlength
               );
      }
      else
      {
-       printf("p_scan_fmac_line: END fmac_line:%d\n"
-              , (int)fmac_line
+       printf("p_scan_fmac_line: END fmac_line:%ld\n"
+              , (long)fmac_line
               );
      }
   }
@@ -334,8 +334,8 @@ p_build_fmac_list(const char *filtermacro_file, GimpRunMode run_mode)
 
   if(gap_debug)
   {
-    printf("p_build_fmac_list: END  fmac_root:%d filtermacro_file:%s\n"
-           ,(int)fmac_root
+    printf("p_build_fmac_list: END  fmac_root:%ld filtermacro_file:%s\n"
+           ,(long)fmac_root
            ,filtermacro_file
            );
   }
@@ -365,8 +365,8 @@ p_merge_fmac_list(FMacElem *fmac_root, const char *filtermacro_file, GimpRunMode
 
   if(gap_debug)
   {
-    printf("p_merge_fmac_list:  fmac_root:%d filtermacro_file:%s\n"
-           ,(int)fmac_root
+    printf("p_merge_fmac_list:  fmac_root:%ld filtermacro_file:%s\n"
+           ,(long)fmac_root
            ,filtermacro_file
            );
   }
@@ -585,6 +585,13 @@ p_fmac_execute_single_filter(GimpRunMode run_mode, gint32 image_id, gint32 drawa
             , GIMP_RUN_WITH_LAST_VALS
             );
 
+  if(gap_debug)
+  {
+    printf("p_fmac_execute_single_filter after pdb call of filtername:%s l_rc:%d\n"
+       ,fmac_elem->filtername
+       ,(int)l_rc
+       );
+  }
   /* restore lastvalues buffer (if we have a valid backup) */
   if(l_lastvalues_bck_buffer)
   {
@@ -599,7 +606,7 @@ p_fmac_execute_single_filter(GimpRunMode run_mode, gint32 image_id, gint32 drawa
 /* ---------------------------------
  * p_find_layer_for_next_processing
  * ---------------------------------
- * find a layer in the image that was newly created (e.g is not
+ * find a layer in the image that was newly created (i.e. is not
  * found in the old_layers_list snaphaot taken of the layerstack
  * before the processing step)
  * If there are more such new layers present, then pick the one
@@ -769,7 +776,7 @@ p_fmac_execute(GimpRunMode run_mode, gint32 image_id, gint32 drawable_id
     fmacContext = &theFmacContext;
 
     gap_fmct_setup_GapFmacContext(fmacContext
-                                 , FALSE  /* no recording_mode  (e.g. apply mode) */
+                                 , FALSE  /* no recording_mode  (i.e. apply mode) */
                                  , filtermacro_file1
                                  );
 
diff --git a/gap/gap_fmac_context.c b/gap/gap_fmac_context.c
index 6993cda..89a9959 100644
--- a/gap/gap_fmac_context.c
+++ b/gap/gap_fmac_context.c
@@ -6,7 +6,7 @@
  *  for animated (or constant) filter apply.
  *  If gap controlled filterapply is done via a filtermacro
  *  the iteration is done within a filtermacro context.
- *  (e.g. while filtermacro is beeing recorded or is applied)
+ *  (i.e. while filtermacro is beeing recorded or is applied)
  *  the handled drawable ids are mapped with the help of a filtermacro reference file
  *  In this case the "persitent_drawable_id" is used to open the referenced
  *  image, frame or videoframe at apply time (this may happen in another gimp
@@ -74,7 +74,7 @@ gap_fmct_set_derived_lookup_filename(GapFmacContext *fmacContext, const char *fi
  * setup a filtermacro context for recording or playback mode.
  * the context affects the behaviour of drawable_iteration in the whole gimp_session
  * until the procedure gap_fmct_disable_GapFmacContext is called.
- * This procedure registers a new frame fetcher resource user_id if playback (e.g NOT recording_mode)
+ * This procedure registers a new frame fetcher resource user_id if playback (i.e. NOT recording_mode)
  * is used. The drawable_iteration will refere to this ffetch_user_id when fetching
  * frames via mapped persistent drawable ids.
  *
@@ -454,15 +454,12 @@ gap_fmct_load_GapFmacContext(GapFmacContext *fmacContext)
 
   for(txf_ptr = txf_ptr_root; txf_ptr != NULL; txf_ptr = (GapValTextFileLines *) txf_ptr->next)
   {
-    gint l_len;
-
     line_nr++;
     if(gap_debug)
     {
       printf("line_nr: %d\n", (int)line_nr);
     }
     gap_file_chop_trailingspace_and_nl(&txf_ptr->line[0]);
-    l_len = strlen(txf_ptr->line);
 
     if(gap_debug)
     {
@@ -533,12 +530,12 @@ gap_fmct_save_GapFmacContext(GapFmacContext *fmacContext)
    */
   for(fmref_entry = fmacContext->fmref_list; fmref_entry != NULL; fmref_entry = fmref_entry->next)
   {
-    fprintf(fp, "%s%06d %s%06d %s%02d %s%d %s%011d  %s%d %s\"%s\""
+    fprintf(fp, "%s%06d %s%06d %s%02d %s%d %s%011ld  %s%d %s\"%s\""
            , GAP_FMREF_ID         , fmref_entry->persistent_drawable_id
            , GAP_FMREF_FRAME_NR   , fmref_entry->frame_nr
            , GAP_FMREF_STACK      , fmref_entry->stackposition
            , GAP_FMREF_TRACK      , fmref_entry->track
-           , GAP_FMREF_MTIME      , fmref_entry->mtime
+           , GAP_FMREF_MTIME      , (long)fmref_entry->mtime
            , GAP_FMREF_TYPE       , fmref_entry->ainfo_type
            , GAP_FMREF_FILE       , fmref_entry->filename
            );
@@ -577,12 +574,12 @@ gap_fmct_debug_print_GapFmacContext(GapFmacContext *fmacContext)
 
   for(fmref_entry = fmacContext->fmref_list; fmref_entry != NULL; fmref_entry = fmref_entry->next)
   {
-    printf("%s%06d %s%06d %s%02d %s%d %s%011d  %s%d %s\"%s\" %s%s\n"
+    printf("%s%06d %s%06d %s%02d %s%d %s%011ld  %s%d %s\"%s\" %s%s\n"
            , GAP_FMREF_ID         , fmref_entry->persistent_drawable_id
            , GAP_FMREF_FRAME_NR   , fmref_entry->frame_nr
            , GAP_FMREF_STACK      , fmref_entry->stackposition
            , GAP_FMREF_TRACK      , fmref_entry->track
-           , GAP_FMREF_MTIME      , fmref_entry->mtime
+           , GAP_FMREF_MTIME      , (long)fmref_entry->mtime
            , GAP_FMREF_TYPE       , fmref_entry->ainfo_type
            , GAP_FMREF_FILE       , fmref_entry->filename
            , GAP_FMREF_PARENTSTACK , fmref_entry->parentpositions
@@ -713,4 +710,3 @@ gap_fmct_add_GapFmacRefEntry(GapLibAinfoType ainfo_type
   return(new_fmref_entry->persistent_drawable_id);
 
 }  /* end gap_fmct_add_GapFmacRefEntry */
-
diff --git a/gap/gap_fmac_main.c b/gap/gap_fmac_main.c
index 1bbc0a2..41f857d 100644
--- a/gap/gap_fmac_main.c
+++ b/gap/gap_fmac_main.c
@@ -132,7 +132,6 @@ static void  p_create_action_area_buttons(fmac_globalparams_t *gpp);
 static void  p_setbutton_sensitivity(fmac_globalparams_t *gpp);
 
 static gboolean  p_chk_filtermacro_file(const char *filtermacro_file);
-static void      p_print_and_free_msg(char *msg, GimpRunMode run_mode);
 static gchar *   p_get_gap_filter_data_string(const char *plugin_name, gint errorcode);
 static gchar *   p_get_mapped_gap_filter_data_string(const char *plugin_name, const char *filtermacro_file);
 static gint      p_fmac_add_filter_to_file(const char *filtermacro_file, const char *plugin_name);
@@ -360,22 +359,6 @@ p_chk_filtermacro_file(const char *filtermacro_file)
 
 
 
-/* --------------------
- * p_print_and_free_msg
- * --------------------
- */
-static void
-p_print_and_free_msg(char *msg, GimpRunMode run_mode)
-{
-  if(run_mode == GIMP_RUN_INTERACTIVE)
-  {
-    g_message("%s", msg);
-  }
-  printf("%s\n", msg);
-  g_free(msg);
-}  /* end p_print_and_free_msg */
-
-
 /* ----------------------------
  * p_get_gap_filter_data_string
  * ----------------------------
@@ -1572,4 +1555,3 @@ p_fmac_pdb_constraint_proc_sel2(gchar *proc_name, gint32 image_id)
 {
   return (p_fmac_pdb_constraint_proc_sel1 (proc_name, image_id));
 }
-
diff --git a/gap/gap_fmac_varying_main.c b/gap/gap_fmac_varying_main.c
index 86bbe7c..40d3568 100644
--- a/gap/gap_fmac_varying_main.c
+++ b/gap/gap_fmac_varying_main.c
@@ -107,12 +107,12 @@ query ()
     {GIMP_PDB_DRAWABLE, "drawable", "Input drawable to be affected by the filtermacro"},
     {GIMP_PDB_STRING, "filtermacro_1", "Name of the 1st filtermacro_file to execute on the input drawable)"},
     {GIMP_PDB_STRING, "filtermacro_2", "Name of the 2nd filtermacro_file to execute on the input drawable)"},
-    {GIMP_PDB_FLOAT, "current_step", "current_step. (e.g curently processed frame) "
+    {GIMP_PDB_FLOAT, "current_step", "current_step. (i.e. curently processed frame) "
                                       " valid range is 0.0 upto total_steps, "
                                       " where 0.0 uses the parameter definitions from filtermacro_1. "
                                       " current_step divided by total_steps defines the value mix ratio"
                                       " A value mix ratio of 1.0 will use the parameter values of 
filtermacro_2."},
-    {GIMP_PDB_INT32, "total_steps",  "total number of steps of varying iterations (e.g. number of frames to 
process)"},
+    {GIMP_PDB_INT32, "total_steps",  "total number of steps of varying iterations (i.e. number of frames to 
process)"},
     
   };
 
@@ -258,7 +258,3 @@ run(const gchar *name
   values[0].data.d_status = status;
 
 }  /* end run */
-
-
-
-
diff --git a/gap/gap_frame_fetcher.c b/gap/gap_frame_fetcher.c
index 145ea8d..8742243 100644
--- a/gap/gap_frame_fetcher.c
+++ b/gap/gap_frame_fetcher.c
@@ -117,7 +117,7 @@
 #define GAP_IMAGE_CACHE_TYPE_PRESCALE_ENABLED 1
 
 typedef struct GapImageCacheParasitePointers {
-  gint32 *mtime_ptr;
+  time_t *mtime_ptr;
   gint32 *ffetch_id_ptr;
   gint32 *type_ptr;
   gint32 *orig_width_ptr;
@@ -206,7 +206,7 @@ static void           p_add_image_to_list_of_duplicated_images(gint32 image_id,
 
 static gint32 p_get_ffetch_max_img_cache_elements();
 static gint32 p_get_ffetch_max_gvc_cache_elements();
-static gint32 ffetch_gva_frames_to_keep_cached();
+static gint32 p_get_ffetch_gva_frames_to_keep_cached();
 
 /* ----------------------------------------------------
  * p_init_GapImageCacheParasitePointers
@@ -597,7 +597,7 @@ p_load_image_and_add_to_cache(const char* filename, gint32 ffetch_user_id
  * in case the flag addToCache is TRUE the image will be automatically added
  * to the cache after read from file operation.
  * Note: this procedure handles only images at original size (GAP_IMAGE_CACHE_TYPE_ORIGINAL_SIZE)
- * a prescaled cached variant of the image will be ignored (e.g NOT be found by this procedure)
+ * a prescaled cached variant of the image will be ignored (i.e. NOT be found by this procedure)
  */
 static gint32
 p_load_cache_image(const char* filename, gint32 ffetch_user_id, gboolean addToCache)
@@ -721,8 +721,8 @@ p_drop_gvahand_cache_elem1(GapFFetchGvahandCache *gvcache)
     {
       if(gap_debug)
       {
-        printf("p_drop_gvahand_cache_elem1 delete:%s (gvahand:%d seltrack:%d mtime:%ld)\n"
-               , gvc_ptr->filename, (int)gvc_ptr->gvahand
+        printf("p_drop_gvahand_cache_elem1 delete:%s (gvahand:%ld seltrack:%d mtime:%ld)\n"
+               , gvc_ptr->filename, (long)gvc_ptr->gvahand
                , (int)gvc_ptr->seltrack, (long)gvc_ptr->mtime);
       }
       GVA_close(gvc_ptr->gvahand);
@@ -1482,10 +1482,10 @@ gap_frame_fetch_register_user(const char *caller_name)
 
   if(gap_debug)
   {
-    printf("gap_frame_fetch_register_user: REGISTRATED ffetch_user_id:%d  caller_name:%s  new_usr_ptr:%d 
pid:%d\n"
+    printf("gap_frame_fetch_register_user: REGISTRATED ffetch_user_id:%d  caller_name:%s  new_usr_ptr:%ld 
pid:%d\n"
           , new_usr_ptr->ffetch_user_id
           , caller_name
-          , (int)&new_usr_ptr
+          , (long)&new_usr_ptr
           , (int) gap_base_getpid()
           );
   }
@@ -1558,7 +1558,7 @@ gap_frame_fetch_unregister_user(gint32 ffetch_user_id)
  * ---------------------------------
  * checks the image for presence of the parasite that marks the image as member
  * of the gap frame fetcher cache.
- * return TRUE if the parasite was found (e.g. image is cache member)
+ * return TRUE if the parasite was found (i.e. image is cache member)
  */
 gboolean
 gap_frame_fetch_is_image_in_cache(gint32 image_id)
@@ -1617,7 +1617,6 @@ p_dump_resources_gvahand()
 {
 #ifdef GAP_ENABLE_VIDEOAPI_SUPPORT
   GapFFetchGvahandCacheElem  *gvc_ptr;
-  GapFFetchGvahandCacheElem  *gvc_last;
   GapFFetchGvahandCache      *gvcache;
   gint32                      count;
 
@@ -1625,7 +1624,6 @@ p_dump_resources_gvahand()
   if(global_gvcache != NULL)
   {
     gvcache = global_gvcache;
-    gvc_last = gvcache->gvc_list;
 
     for(gvc_ptr = gvcache->gvc_list; gvc_ptr != NULL; gvc_ptr = (GapFFetchGvahandCacheElem *)gvc_ptr->next)
     {
@@ -1641,12 +1639,11 @@ p_dump_resources_gvahand()
         , (int)GVA_get_fcache_size_in_bytes(gvahand)
         );
 
-      gvc_last = gvc_ptr;
     }
     printf("FrameFetcher holds %d open GVA_handles limit gap_ffetch_max_gvc_cache_elements:%d 
(fcache_size:%d)\n"
        ,(int)count
        ,(int)p_get_ffetch_max_gvc_cache_elements()
-       ,(int)p_get_ffetch_gva_frames_to_keep_cached
+       ,(int)p_get_ffetch_gva_frames_to_keep_cached()
        );
 
   }
@@ -1770,8 +1767,8 @@ gap_frame_fetch_dump_resources()
 
       l_number_of_cached_images++;
 
-      l_cacheInfoString = g_strdup_printf("Cache member: mtime:%d ffetchId:%d %s"
-                                         ,*(paraPtr->mtime_ptr)
+      l_cacheInfoString = g_strdup_printf("Cache member: mtime:%ld ffetchId:%d %s"
+                                         ,(long)*(paraPtr->mtime_ptr)
                                          ,*(paraPtr->ffetch_id_ptr)
                                          ,paraPtr->filename_ptr
                                          );
@@ -1833,4 +1830,3 @@ gap_frame_fetch_dump_resources()
   p_dump_process_resource_usage();
 
 }  /* end gap_frame_fetch_dump_resources */
-
diff --git a/gap/gap_image.c b/gap/gap_image.c
index 49c9e6c..2e05da4 100644
--- a/gap/gap_image.c
+++ b/gap/gap_image.c
@@ -504,7 +504,7 @@ gap_image_remove_all_guides(gint32 image_id)
  * Note that gimp-2.7 or later versions supports layer groups.
  * this procedure does only check for toplevel layers
  * and ignores layers that are nested in groups.
- * e.g. a top level group counts as one single layer
+ * A top level group counts as one single layer
  * no matter how many layers und subgroups are in the toplevel group.
  *
  */
@@ -889,12 +889,10 @@ gap_image_find_or_create_group_layer(gint32 image_id
   gchar     **nameArray;
   gchar      *namePtr;
   gint        l_nlayers;
-  gint        l_treelevel;
   gint        l_ii;
   gint        l_idx;
   gint        l_position;
   gint32     *l_src_layers;
-  gint32      l_layer_id;
 
   gint32      l_parent_layer_id;
   gint32      l_group_layer_id;
@@ -1025,7 +1023,7 @@ gap_image_find_or_create_group_layer(gint32 image_id
       }
       else
       {
-        /* check next treelevel e.g. members of the current group */
+        /* check next treelevel i.e. members of the current group */
         l_src_layers = gimp_item_get_children (l_parent_layer_id, &l_nlayers);
       }
     }
@@ -1333,7 +1331,7 @@ gap_image_get_layers_at_parentpositions(gint32 image_id, gint *nlayers, const ch
       {
         gint32 l_layer_id;
         
-        l_layer_id == l_layers_list[l_pos];
+        l_layer_id = l_layers_list[l_pos];
         if (gimp_item_is_group(l_layer_id))
         {
           g_free(l_layers_list);
@@ -1392,4 +1390,3 @@ gap_image_get_layers_at_parentpositions(gint32 image_id, gint *nlayers, const ch
 
 
 } /* end gap_image_get_layers_at_parentpositions */
-
diff --git a/gap/gap_layer_copy.c b/gap/gap_layer_copy.c
index ced4642..f1c866e 100644
--- a/gap/gap_layer_copy.c
+++ b/gap/gap_layer_copy.c
@@ -687,7 +687,7 @@ gap_layer_flip(gint32 layer_id, gint32 flip_request)
  * copy specified dst_drawable into src_drawable using
  * gimp copy paste procedures.
  * The selection in the specified image will be removed
- * (e.g. is ignored for copying)
+ * (and therefore is ignored for copying)
  * the caller shall specify image_id == -1 in case where selection
  * shall be respected.
  */
@@ -886,7 +886,7 @@ gap_layer_create_layer_from_alpha(gint32 src_layer_id, gint32 image_id
 
   if (l_old_layermask_id >= 0)
   {
-    /* handle already exiting layermask: apply or remove (e.g. ignore) */
+    /* handle already exiting layermask: apply or remove (i.e. ignore) */
     if (applyExistingLayermask)
     {
        /* merge the already existing layermask into the alpha channel */
diff --git a/gap/gap_lib.c b/gap/gap_lib.c
index 7b7e1c4..cd375b7 100644
--- a/gap/gap_lib.c
+++ b/gap/gap_lib.c
@@ -1962,7 +1962,7 @@ gap_lib_get_frame_nr_from_name(char *fname)
  * gap_lib_get_frame_nr
  * -------------------------------
  * return -1 if the specified image is
- *           NOT a gimp-gap typical frame image (e.g. has no number part in its filename)
+ *           NOT a gimp-gap typical frame image (i.e. has no number part in its filename)
  * return the number part in case of valid frame image.
  */
 long
@@ -2167,7 +2167,7 @@ gap_lib_save_non_xcf_dialog(char *key_gimprc, char *lower_extension)
                         "This dialog configures how to handle exchanges of\n"
                         "the current frame image (for frames with extension %s)\n"
                         "Note that automatical save on frame change just works with XCF\n"
-                        "but automatical overwrite (e.g export) to other formats\n"
+                        "but automatical overwrite (via export) to other formats\n"
                         "typically results in loss of layers and other information.")
                         , lower_extension);
 
@@ -2236,11 +2236,11 @@ gap_lib_save_non_xcf_dialog(char *key_gimprc, char *lower_extension)
  *   shall decide how to handle frame excanges.
  *   The options:
  *     SAVE_MODE_FOR_NON_XCF_ASK
- *        in case the user cancelled the dialog (e.g did not decide)
+ *        in case the user cancelled the dialog (i.e. did not decide)
  *        frame excange shall be blocked
  *
  *     SAVE_MODE_FOR_NON_XCF_AS_IS
- *        the current frame will be exported as is (e.g without flattening)
+ *        the current frame will be exported as is (i.e. without flattening)
  *        the returncode depends on the result of the export.
  *        ("as it is" will save only the background layer in 
  *         fileformat types that do not support multiple layers)
diff --git a/gap/gap_locate.c b/gap/gap_locate.c
index 14f38cf..7354c27 100644
--- a/gap/gap_locate.c
+++ b/gap/gap_locate.c
@@ -751,7 +751,7 @@ static void p_locateDetailLoop(GapLocateContext *lctx)
  * in the corresponding target Drawable in a loop while
  * varying offsets within targetMoveRadius.
  * the targetX/Y koords are picked at those offsets where the compared areas
- * are best matching (e.g with minimun color difference)
+ * are best matching (that is with minimun color difference)
  * the return value is the minimum colordifference value
  * (in range 0.0 to 1.0 where 0.0 indicates that the compared area is exactly equal)
  *
diff --git a/gap/gap_main.c b/gap/gap_main.c
index cdc70ad..e2e10cc 100644
--- a/gap/gap_main.c
+++ b/gap/gap_main.c
@@ -513,7 +513,7 @@ GimpPlugInInfo PLUG_IN_INFO =
 
     {GIMP_PDB_INT32,  "new_position", "new stackposition within the image or in the new group. is only used 
at action reorder."},
     {GIMP_PDB_STRING, "new_groupname", "is only used at action reorder. the selected layer(s) is(are) moved 
to this new_groupname (group will be created automatically if it does not already exist)"},
-    {GIMP_PDB_STRING, "select_groupname", "defines the selection scope, e.g. the name of the group where its 
layers can be selected by name or position(s). An empty string defines the images toplevel layers as 
selection scope"},
+    {GIMP_PDB_STRING, "select_groupname", "defines the selection scope, that is the name of the group where 
its layers can be selected by name or position(s). An empty string defines the images toplevel layers as 
selection scope"},
     {GIMP_PDB_STRING, "delimiter", "Delimiter characterstring used in group names to identify subgroup 
names."},
   };
   static int nargs_modify = G_N_ELEMENTS (args_modify);
@@ -1792,3 +1792,4 @@ run (const gchar *name
   /* remove LOCK on this image for all gap_plugins */
   gap_lock_remove_lock(lock_image_id);
 }
+
diff --git a/gap/gap_mod_layer.c b/gap/gap_mod_layer.c
index 55a645f..4ef0fab 100644
--- a/gap/gap_mod_layer.c
+++ b/gap/gap_mod_layer.c
@@ -2177,7 +2177,7 @@ gap_mod_frames_modify(GapAnimInfo *ainfo_ptr,
 
       if(progress_bar != NULL)
       {
-        guchar *progressText;
+        gchar *progressText;
         progressText = g_strdup_printf("frame:%d (%d)", (int)l_cur_frame_nr, (int)l_end);
 
         gtk_progress_bar_set_text(GTK_PROGRESS_BAR(progress_bar), progressText);
@@ -2301,7 +2301,6 @@ gint gap_mod_layer(GimpRunMode run_mode, gint32 image_id,
   gint32    l_sel_case;
   gint32    l_sel_invert;
   GtkWidget *progress_bar;
-  GtkWidget *dlg;
 
   char      l_sel_pattern[MAX_LAYERNAME];
   char      l_new_layername[MAX_LAYERNAME];
@@ -2312,7 +2311,6 @@ gint gap_mod_layer(GimpRunMode run_mode, gint32 image_id,
 
   l_rc = 0;
   progress_bar = NULL;
-  dlg = NULL;
 
   l_delimiter[0] = '/';
   l_delimiter[1] = '\0';
@@ -2331,9 +2329,11 @@ gint gap_mod_layer(GimpRunMode run_mode, gint32 image_id,
          /* note: for interactive call the processing is already done
           * as callback of the dialog
           */
+         l_sel_case = sel_case;
+         l_sel_invert = sel_invert;
          l_rc = gap_mod_frames_dialog (ainfo_ptr, &l_from, &l_to,
                                        &l_action_mode,
-                                       &l_sel_mode, &sel_case, &sel_invert,
+                                       &l_sel_mode, &l_sel_case, &l_sel_invert,
                                        &l_sel_pattern[0], &l_new_layername[0],
                                        &l_new_position,
                                        &l_new_groupname[0], &l_sel_groupname[0], &l_delimiter[0]
@@ -2374,7 +2374,7 @@ gint gap_mod_layer(GimpRunMode run_mode, gint32 image_id,
          */
            l_rc = gap_mod_frames_modify(ainfo_ptr, l_from, l_to,
                                   l_action_mode,
-                                  l_sel_mode, sel_case, sel_invert,
+                                  l_sel_mode, l_sel_case, l_sel_invert,
                                   &l_sel_pattern[0], &l_new_layername[0],
                                   l_new_position,
                                   &l_new_groupname[0], &l_sel_groupname[0], &l_delimiter[0],
diff --git a/gap/gap_mod_layer_dialog.c b/gap/gap_mod_layer_dialog.c
index f10d79d..896f3f2 100644
--- a/gap/gap_mod_layer_dialog.c
+++ b/gap/gap_mod_layer_dialog.c
@@ -458,9 +458,15 @@ p_func_optionmenu_callback  (GtkWidget     *wgt_item,
   const char *title;
   const char *tiptext;
 
- if(gap_debug) printf("CB: p_func_optionmenu_callback\n");
+ if(gap_debug)
+ {
+   printf("CB: p_func_optionmenu_callback\n");
+ }
 
- if(gmop == NULL) return;
+ if(gmop == NULL)
+ {
+   return;
+ }
 
  l_idx = GPOINTER_TO_INT(g_object_get_data (G_OBJECT (wgt_item),
                                             MENU_ITEM_INDEX_KEY));
@@ -469,8 +475,10 @@ p_func_optionmenu_callback  (GtkWidget     *wgt_item,
 
  if(gap_debug)
  {
-    printf("CB: p_func_optionmenu_callback index: %d\n"
-          , (int)l_idx);
+    printf("CB: p_func_optionmenu_callback index: %d %s\n"
+          , (int)l_idx
+          , (tiptext == NULL) ? "<null>" : tiptext
+          );
  }
 
  gmop->action_mode = l_idx;
@@ -1263,12 +1271,10 @@ p_create_mod_frames_dialog(GapModFramesGlobalParams *gmop)
 {
   GtkWidget *dlg;
   GtkWidget *main_vbox;
-  GtkWidget *active_vbox;
   GtkWidget *hbox;
   GtkWidget *frame;
   GtkWidget *entry;
   GtkWidget *table;
-  GtkWidget *func_table;
   GtkWidget *sel_table;
   GtkWidget *sel_sub_table;
   GtkWidget *range_table;
@@ -1318,7 +1324,6 @@ p_create_mod_frames_dialog(GapModFramesGlobalParams *gmop)
   gtk_widget_show (frame);
 
   table = gtk_table_new (3, 2, FALSE);
-  func_table = table;
   gtk_table_set_col_spacings (GTK_TABLE (table), 4);
   gtk_table_set_row_spacings (GTK_TABLE (table), 4);
   gtk_container_add (GTK_CONTAINER (frame), table);
@@ -1532,7 +1537,7 @@ p_create_mod_frames_dialog(GapModFramesGlobalParams *gmop)
                     ,(GtkAttachOptions) (GTK_FILL)
                     ,(GtkAttachOptions) (0), 0, 0);
   gimp_help_set_help_data (check_button
-                          , _("Perform actions on all unselected layers at same level in the layers tree 
(e.g. in the same group)")
+                          , _("Perform actions on all unselected layers at same level in the layers tree 
(i.e. in the same group)")
                           , NULL);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check_button)
                                 , gmop->sel_invert);
@@ -1640,7 +1645,7 @@ p_create_mod_frames_dialog(GapModFramesGlobalParams *gmop)
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_button),
                                    l_radio_pressed);
   gimp_help_set_help_data(radio_button
-                         , _("Select all visible layers at same level in the layers tree (e.g. in the same 
group)")
+                         , _("Select all visible layers at same level in the layers tree (i.e. in the same 
group)")
                          , NULL);
 
   gtk_widget_show (radio_button);
diff --git a/gap/gap_morph_dialog.c b/gap/gap_morph_dialog.c
index cae1a4b..2cd71b0 100644
--- a/gap/gap_morph_dialog.c
+++ b/gap/gap_morph_dialog.c
@@ -3468,7 +3468,7 @@ gap_morph_create_dialog(GapMorphGUIParams *mgup)
                          GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                          GTK_STOCK_OK,     GTK_RESPONSE_OK,
                          NULL);
-  gtk_window_set_type_hint (dlg, GDK_WINDOW_TYPE_HINT_NORMAL);
+  gtk_window_set_type_hint (GTK_WINDOW(dlg), GDK_WINDOW_TYPE_HINT_NORMAL);
 
   mgup->shell = dlg;
   mgup->src_win.startup_flag = TRUE;
@@ -4076,7 +4076,11 @@ gap_morph_dialog(GapMorphGlobalParams *mgpp)
   mgup->workpointGenerationBusy = FALSE;
   mgup->cancelWorkpointGeneration = FALSE;
 
-  if(gap_debug) printf("gap_morph_dialog: START mgpp->master_wp_list: %d\n", (int)mgpp->master_wp_list);
+  if(gap_debug)
+  {
+    printf("gap_morph_dialog: START mgpp->master_wp_list: %ld\n"
+      , (long)mgpp->master_wp_list);
+  }
 
   /* startup with empty workpoint list
    * (the pointer may be initalized with illegal adress
diff --git a/gap/gap_morph_exec.c b/gap/gap_morph_exec.c
index e998421..e754488 100644
--- a/gap/gap_morph_exec.c
+++ b/gap/gap_morph_exec.c
@@ -1752,13 +1752,13 @@ p_calculate_work_point_movement(gdouble total_steps
     {
       countPoints++;
     }
-    printf ("p_calculate_work_point_movement: START total_steps:%.2f current_step:%.2f forward_move:%d 
scalex:%.3f scaley:%.3f master_list:%d countPoints:%d\n"
+    printf ("p_calculate_work_point_movement: START total_steps:%.2f current_step:%.2f forward_move:%d 
scalex:%.3f scaley:%.3f master_list:%ld countPoints:%d\n"
       ,(float)total_steps
       ,(float)current_step
       ,(int)forward_move
       ,(float)scalex
       ,(float)scaley
-      ,(int)master_list
+      ,(long)master_list
       ,(int)countPoints
       );
   }
@@ -3289,7 +3289,6 @@ p_morph_render_frame_tweens_in_subdir(GapAnimInfo *ainfo_ptr, GapMorphGlobalPara
   gint32 l_tween_layer_id;
   gint32 l_rc;
   gint   l_errno;
-  gint32 frameCount;
   gint32 currFrameNr;
   gint32 nextFrameNr;
   gint32 nextTargetFrameNr;
@@ -3299,7 +3298,6 @@ p_morph_render_frame_tweens_in_subdir(GapAnimInfo *ainfo_ptr, GapMorphGlobalPara
   gint32 nextLayerId;
   gint32 firstFrameNr;
   gint32 lastFrameNr;
-  gdouble framesToProcess;
   gdouble nTweenFramesTotal;   /* for outer progress (frames that are just copied are not included in 
progress) */
   gdouble nTweenFramesDone;    /* rendered tween frames so far (frames that are just copied are not 
included) */
 
@@ -3355,7 +3353,6 @@ p_morph_render_frame_tweens_in_subdir(GapAnimInfo *ainfo_ptr, GapMorphGlobalPara
   }
 
 
-  frameCount = 0;
   nextLayerId = -1;
  
   if(gap_lib_chk_framerange(ainfo_ptr) != 0)
@@ -3392,7 +3389,6 @@ p_morph_render_frame_tweens_in_subdir(GapAnimInfo *ainfo_ptr, GapMorphGlobalPara
 
     /* recalculate (in case range_to is changed on GUI while processing is already running) */
     lastFrameNr = MIN(mgpp->range_to, ainfo_ptr->last_frame_nr);
-    framesToProcess = MAX(1, (lastFrameNr - currFrameNr) -1);
     nTweenFramesTotal = MAX(1.0, (lastFrameNr - firstFrameNr) * mgpp->master_tween_steps);
    
     if (nextFrameNr > lastFrameNr)
@@ -3819,4 +3815,3 @@ gap_morph_render_frame_tweens(GapAnimInfo *ainfo_ptr, GapMorphGlobalParams *mgpp
   return(l_tween_layer_id);
 
 }  /* end gap_morph_render_frame_tweens */
-
diff --git a/gap/gap_morph_shape.c b/gap/gap_morph_shape.c
index e4a70f8..13968ab 100644
--- a/gap/gap_morph_shape.c
+++ b/gap/gap_morph_shape.c
@@ -212,7 +212,7 @@ gap_morph_shape_new_workpont(gdouble srcx, gdouble srcy, gdouble dstx, gdouble d
 static void
 p_doProgress(GapMorphShapeContext *msctx)
 {
-  guchar *progressText;
+  gchar *progressText;
   gdouble percentage;
 
   if(msctx->doProgress != TRUE)
@@ -1307,6 +1307,3 @@ gap_morph_shape_generate_frame_tween_workpoints(GapAnimInfo *ainfo_ptr
 
   return (frameCount);
 }  /* end gap_morph_shape_generate_frame_tween_workpoints */
-
-
-
diff --git a/gap/gap_morph_tween_dialog.c b/gap/gap_morph_tween_dialog.c
index 2c088ff..6cab1cc 100644
--- a/gap/gap_morph_tween_dialog.c
+++ b/gap/gap_morph_tween_dialog.c
@@ -30,6 +30,7 @@
 #include <libgimp/gimpui.h>
 
 #include "gap_morph_main.h"
+#include "gap_morph_exec.h"
 #include "gap_morph_tween_dialog.h"
 #include "gap_morph_shape.h"
 #include "gap_base.h"
@@ -674,7 +675,7 @@ gap_morph_generate_frame_tween_workpoints_dialog(GapAnimInfo *ainfo_ptr, GapMorp
                                            -1);
 
   gimp_window_set_transient (GTK_WINDOW (dialog));
-  gtk_window_set_type_hint (dialog, GDK_WINDOW_TYPE_HINT_NORMAL);
+  gtk_window_set_type_hint (GTK_WINDOW(dialog), GDK_WINDOW_TYPE_HINT_NORMAL);
 
   g_signal_connect (G_OBJECT (dialog), "response",
                     G_CALLBACK (on_workpoint_generator_response),
@@ -838,7 +839,7 @@ gap_morph_generate_frame_tween_workpoints_dialog(GapAnimInfo *ainfo_ptr, GapMorp
                                   "Workpoints are generated on detected edges. "
                                   "Edges are detected on pixels where color or opacity differs significant "
                                   "from the neighbor pixel."
-                                  "(e.g. more than the specified edge detection threshold)."),
+                                  "(i.e. more than the specified edge detection threshold)."),
                                 NULL);
   g_signal_connect (adj, "value-changed",
                       G_CALLBACK (gimp_double_adjustment_update),
@@ -1132,7 +1133,7 @@ gap_morph_frame_tweens_dialog(GapAnimInfo *ainfo_ptr, GapMorphGlobalParams *mgpp
                                            -1);
 
   gimp_window_set_transient (GTK_WINDOW (dialog));
-  gtk_window_set_type_hint (dialog, GDK_WINDOW_TYPE_HINT_NORMAL);
+  gtk_window_set_type_hint (GTK_WINDOW(dialog), GDK_WINDOW_TYPE_HINT_NORMAL);
 
   g_signal_connect (G_OBJECT (dialog), "response",
                     G_CALLBACK (on_morph_frame_tweens_response),
@@ -1375,3 +1376,4 @@ gap_morph_frame_tweens_dialog(GapAnimInfo *ainfo_ptr, GapMorphGlobalParams *mgpp
   return (mtg->ret);
 
 } /* end gap_morph_frame_tweens_dialog */
+
diff --git a/gap/gap_mov_dialog.c b/gap/gap_mov_dialog.c
index 0ad628e..c8c38f0 100644
--- a/gap/gap_mov_dialog.c
+++ b/gap/gap_mov_dialog.c
@@ -365,7 +365,7 @@ static void        p_reset_points            ();
 static void        p_clear_one_point         (gint idx);
 static void        p_mix_one_point(gint idx, gint ref1, gint ref2, gdouble mix_factor);
 static void        p_refresh_widgets_after_load(t_mov_gui_stuff *mgp);
-static void        p_load_points             (char *filename);
+static void        p_load_points             (char *filename, t_mov_gui_stuff *mgp);
 static void        p_save_points             (char *filename, t_mov_gui_stuff *mgp);
 
 static GimpDrawable * p_get_flattened_drawable (gint32 image_id);
@@ -2659,7 +2659,7 @@ p_points_load_from_file (GtkWidget *widget,
   gtk_widget_destroy(GTK_WIDGET(mgp->filesel));
   mgp->filesel = NULL;
 
-  p_load_points(mgp->pointfile_name);
+  p_load_points(mgp->pointfile_name, mgp);
   p_refresh_widgets_after_load(mgp);
   mov_set_instant_apply_request(mgp);
 }  /* end p_points_load_from_file */
@@ -3478,12 +3478,12 @@ p_clear_one_point(gint idx)
     pvals->point[idx].keyframe = 0;   /* 0: controlpoint is not fixed to keyframe */
     pvals->point[idx].keyframe_abs = 0;   /* 0: controlpoint is not fixed to keyframe */
 
-    pvals->point[idx].accPosition = 0;           /* 0: linear (e.g NO acceleration) is default */
-    pvals->point[idx].accOpacity = 0;            /* 0: linear (e.g NO acceleration) is default */
-    pvals->point[idx].accSize = 0;               /* 0: linear (e.g NO acceleration) is default */
-    pvals->point[idx].accRotation = 0;           /* 0: linear (e.g NO acceleration) is default */
-    pvals->point[idx].accPerspective = 0;        /* 0: linear (e.g NO acceleration) is default */
-    pvals->point[idx].accSelFeatherRadius = 0;   /* 0: linear (e.g NO acceleration) is default */
+    pvals->point[idx].accPosition = 0;           /* 0: linear (NO acceleration) is default */
+    pvals->point[idx].accOpacity = 0;            /* 0: linear (NO acceleration) is default */
+    pvals->point[idx].accSize = 0;               /* 0: linear (NO acceleration) is default */
+    pvals->point[idx].accRotation = 0;           /* 0: linear (NO acceleration) is default */
+    pvals->point[idx].accPerspective = 0;        /* 0: linear (NO acceleration) is default */
+    pvals->point[idx].accSelFeatherRadius = 0;   /* 0: linear (NO acceleration) is default */
 
   }
 }       /* end p_clear_one_point */
@@ -3605,7 +3605,7 @@ p_filename_ends_with_etension_xml(const char *filename)
  * ============================================================================
  */
 void
-p_load_points(char *filename)
+p_load_points(char *filename, t_mov_gui_stuff *mgp)
 {
   gint l_rc;
   gint l_errno;
@@ -3618,9 +3618,30 @@ p_load_points(char *filename)
                                   ,gimp_image_width(pvals->dst_image_id)
                                   ,gimp_image_height(pvals->dst_image_id)
                                   );
-    if (!l_xmlOk)
+    if (l_xmlOk)
+    {
+      if (mgp->ainfo_ptr != NULL)
+      {
+        if (mgp->ainfo_ptr->last_frame_nr >= 0)
+        {
+          /* constraint destination range to current destination frames valid range
+           * that is setup in the ainfo_ptr->first/last_frame_nr
+           * (the xml file imports the range as recorded
+           * in other conditions)
+           */
+          pvals->dst_range_end = CLAMP(pvals->dst_range_end
+                                    , mgp->ainfo_ptr->first_frame_nr
+                                    , mgp->ainfo_ptr->last_frame_nr
+                                    );
+          pvals->dst_range_start = CLAMP(pvals->dst_range_end
+                                    , mgp->ainfo_ptr->first_frame_nr
+                                    , mgp->ainfo_ptr->last_frame_nr
+                                    );
+        }
+      }
+    }
+    else
     {
-
       if(l_errno != 0)
       {
         g_message(_("ERROR: Could not open xml parameterfile\n"
@@ -3634,7 +3655,6 @@ p_load_points(char *filename)
                ,filename);
       }
 
-
     }
 
     return;
@@ -5048,7 +5068,7 @@ mov_acc_tab_create (t_mov_gui_stuff *mgp)
   gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0);
 
 
-  /*  accelaration characteristic for Position (e.g. movement) */
+  /*  accelaration characteristic for Position (i.e. movement) */
   adj = p_mov_acc_spinbutton_new( GTK_TABLE (table), 0, 0,        /* table col, row */
                           _("Movement:"),                     /* label text */
                           SCALE_WIDTH, ENTRY_WIDTH,           /* scalesize spinsize */
@@ -5089,7 +5109,7 @@ mov_acc_tab_create (t_mov_gui_stuff *mgp)
 
 
 
-  /*  accelaration characteristic for Size (e.g. Zoom) */
+  /*  accelaration characteristic for Size (i.e. Zoom) */
   adj = p_mov_acc_spinbutton_new( GTK_TABLE (table), 3, 0,        /* table col, row */
                           _("Scale:"),                        /* label text */
                           SCALE_WIDTH, ENTRY_WIDTH,           /* scalesize spinsize */
@@ -6983,7 +7003,7 @@ gap_mov_dlg_move_dialog_singleframe(GapMovSingleFrame *singleFramePtr)
   gap_arr_arg_init(&argv[l_ii], GAP_ARR_WGT_INT_PAIR);
   argv[l_ii].constraint = TRUE;
   argv[l_ii].label_txt = _("Current Frame:");
-  argv[l_ii].help_txt  = _("Curent Frame number (e.g. phase to be phase Total number of frames");
+  argv[l_ii].help_txt  = _("Curent Frame number (i.e. current phase) of Total number of frames");
   argv[l_ii].int_min   = (gint)1;
   argv[l_ii].int_max   = (gint)MAX(10000, singleFramePtr->total_frames);
   argv[l_ii].int_ret   = (gint)CLAMP(singleFramePtr->frame_phase, 1, argv[l_ii].int_max);
diff --git a/gap/gap_mov_exec.c b/gap/gap_mov_exec.c
index 744214c..e57e462 100644
--- a/gap/gap_mov_exec.c
+++ b/gap/gap_mov_exec.c
@@ -1165,7 +1165,7 @@ p_calculate_posFactor_from_FrameTweens(gdouble frameTweensInSegment
  * Mode with acceleration characteristic:
  * ========================================
  *   a Path segment includes all controlpoints between two keyframes
- *   (e.g controlpoints where keyframe > 0) Note that first and last contolpoint
+ *   (i.e. controlpoints where keyframe > 0) Note that first and last contolpoint
  *   are implicite keyframes.
  *   In case none of the contolpoints has keyframe > 0, all controlpoints
  *   are in just one segment that starts at first and ends at last controlpoint.
@@ -1425,7 +1425,7 @@ p_calculate_settings_for_current_FrameTween(
   }
 
 
-  /* calculate Zoom (e.g. Size) settings for the currently processed Frame (or tween) */
+  /* calculate Zoom (i.e. Size) settings for the currently processed Frame (or tween) */
   if ((val_ptr->point[startOfSegmentIndex].accSize != 0)
   && (frameTweensInSegment > 0))
   {
@@ -1643,6 +1643,22 @@ p_log_current_render_params(GapMovData *mov_ptr, GapMovCurrent *cur_ptr)
 
 }  /* end p_log_current_render_params */
 
+glong
+p_get_gap_controlpoint_loglimit()
+{
+  const gchar *l_env;
+  glong  l_log_limit;
+
+  l_log_limit = 999999;
+  l_env = g_getenv("GAP_CONTROLPOINT_LOGLIMIT");
+  if(l_env != NULL)
+  {
+    l_log_limit = atol(l_env);
+  }
+
+  return (l_log_limit);
+}
+
 
 /* --------------------------------
  * p_printf_log_parameters
@@ -1652,7 +1668,14 @@ p_log_current_render_params(GapMovData *mov_ptr, GapMovCurrent *cur_ptr)
 static void
 p_printf_log_parameters(GapMovData *mov_ptr)
 {
-  gint l_idx;
+  gint  l_idx;
+  glong l_log_limit;
+  
+  
+
+  printf("p_printf_log_parameters ------------------ START\n");
+
+  l_log_limit = p_get_gap_controlpoint_loglimit();
 
   printf("apv_mlayer_image: %ld\n", (long)mov_ptr->val_ptr->apv_mlayer_image);
   printf("apv_mode: %ld\n", (long)mov_ptr->val_ptr->apv_mode);
@@ -1700,8 +1723,17 @@ p_printf_log_parameters(GapMovData *mov_ptr)
 
     printf("keyframe[%d] :%d\n", l_idx, mov_ptr->val_ptr->point[l_idx].keyframe);
     printf("keyframe_abs[%d] :%d\n", l_idx, mov_ptr->val_ptr->point[l_idx].keyframe_abs);
+    
+    if (l_idx > l_log_limit)
+    {
+      printf(" .. points up to %d are not logged due to environment variable  GAP_CONTROLPOINT_LOGLIMIT\n"
+         ,(int) mov_ptr->val_ptr->point_idx_max
+         );
+      break;
+    }
   }
   printf("\n");
+  printf("p_printf_log_parameters ------------------ DONE\n");
 
 }  /* end p_printf_log_parameters */
 
@@ -1894,7 +1926,7 @@ p_duplicate_layer(gint32 layerId)
  * The source layer is iterated through all layers of the sourceimage
  * according to multilayer image based stemmode parameter v.
  * for the frame based stepmodes, interprete the src as frame image sequence
- * (e.g iterate through flattened copied of src frame images instead of iterating layers)
+ * (i.e. iterate through flattened copied of src frame images instead of iterating layers)
  *
  * For the placement the layers act as if their size is equal to their
  * Sourceimages size.
@@ -1953,11 +1985,13 @@ p_mov_execute_or_query_2(GapMovData *mov_ptr, GapMovQuery *mov_query, gdouble  *
    gint startOfSegmentIndex;
    gint endOfSegmentIndex;
    gint frameNrAtEndOfSegment;
+   glong l_log_limit;
 
    if(gap_debug)
    {
      printf("p_mov_execute_or_query_2 START\n");
    }
+   l_log_limit = p_get_gap_controlpoint_loglimit();
 
 
    if(mov_ptr->val_ptr->src_image_id < 0)
@@ -2148,7 +2182,10 @@ p_mov_execute_or_query_2(GapMovData *mov_ptr, GapMovQuery *mov_query, gdouble  *
 
    /* how many frames are affected from one line of the moving path */
    l_fpl = ((gdouble)l_frames - 1.0) / ((gdouble)(l_points -1));
-   if(gap_debug) printf("p_mov_execute: initial l_fpl=%f\n", l_fpl);
+   if(gap_debug)
+   {
+     printf("p_mov_execute: initial l_fpl=%f\n", l_fpl);
+   }
 
    /* calculate flt_timing_tab controlpoint timing table considering keyframes */
    l_prev_keyptidx = 0;
@@ -2170,7 +2207,10 @@ p_mov_execute_or_query_2(GapMovData *mov_ptr, GapMovQuery *mov_query, gdouble  *
             l_prev_keyframe = l_frames -1;
 
             l_prev_keyptidx = l_idk;
-            if(gap_debug) printf("p_mov_execute: last point is implicite keyframe l_fpl=%f\n", l_fpl);
+            if(gap_debug) 
+            {
+              printf("p_mov_execute: last point is implicite keyframe l_fpl=%f\n", l_fpl);
+            }
             break;
           }
           else
@@ -2182,7 +2222,13 @@ p_mov_execute_or_query_2(GapMovData *mov_ptr, GapMovQuery *mov_query, gdouble  *
               l_prev_keyframe = val_ptr->point[l_idk].keyframe;
 
               l_prev_keyptidx = l_idk;
-              if(gap_debug) printf("p_mov_execute: keyframe l_fpl=%f\n", l_fpl);
+              if(gap_debug)
+              {
+                if(l_idk <= l_log_limit)
+                {
+                  printf("p_mov_execute: keyframe l_fpl=%f\n", l_fpl);
+                }
+              }
               break;
             }
           }
@@ -2227,10 +2273,20 @@ p_mov_execute_or_query_2(GapMovData *mov_ptr, GapMovQuery *mov_query, gdouble  *
 
    if(gap_debug)
    {
+     glong l_log_limit;
+     l_log_limit = p_get_gap_controlpoint_loglimit();
+   
      printf("p_mov_execute: --- CONTROLPOINT relative frametiming TABLE -----\n");
      for(l_ptidx=0;  l_ptidx < l_points; l_ptidx++)
      {
        printf("p_mov_execute: flt_timing_tab[%02d] = %f\n", (int)l_ptidx, (float)flt_timing_tab[l_ptidx]);
+       if (l_ptidx > l_log_limit)
+       {
+         printf(" .. points up to %d are not logged due to environment variable  GAP_CONTROLPOINT_LOGLIMIT\n"
+           ,(int) l_points
+           );
+         break;
+       }
      }
    }
 
@@ -2486,7 +2542,7 @@ p_mov_execute_or_query_2(GapMovData *mov_ptr, GapMovQuery *mov_query, gdouble  *
  * ---------------------------
  * transform and move layer (specified by mov_ptr->singleFramePtr->drawable_id)
  * according to move path controlpoints in one destination frame
- * at the specified pahse (e.g. frame number within a frame range)
+ * at the specified pahse (i.e. frame number within a frame range)
  *
  * in case the  mov_ptr->singleFramePtr->drawable_id is NOT already part
  * of the processed frame it will be copied to the frame and
@@ -2626,7 +2682,7 @@ p_mov_execute_singleframe_2(GapMovData *mov_ptr, gdouble *flt_timing_tab)
    gap_mov_exec_set_handle_offsets_singleframe(val_ptr, cur_ptr);
 
    /* mov_ptr->val_ptr->src_stepmode is ignored in singleframes mode
-    * (e.g. behaves like GAP_STEP_FRAME_NONE)
+    * (it behaves like GAP_STEP_FRAME_NONE)
     */
    {
      gint32        l_sel_channel_id;
@@ -3870,18 +3926,18 @@ gchar *gap_mov_exec_chk_keyframes(GapMovValues *pvals)
 
   for(l_idx = 0; l_idx < pvals->point_idx_max; l_idx++ )
   {
-     if(pvals->point[l_idx].keyframe_abs != 0)
+     if((pvals->point[l_idx].keyframe_abs != 0) && (l_idx > 0))
      {
          pvals->point[l_idx].keyframe = gap_mov_exec_conv_keyframe_to_rel(pvals->point[l_idx].keyframe_abs, 
pvals);
 
-         if(pvals->point[l_idx].keyframe > l_affected_frames - 2)
-         {
-            l_err = g_strdup_printf(_("\nError: Keyframe %d at point [%d] higher or equal than last handled 
frame")
-                                      , pvals->point[l_idx].keyframe_abs,  l_idx+1);
-            l_err_lbltext = g_strdup_printf("%s%s", l_err_lbltext, l_err);
-            g_free(l_err);
-            l_errcount++;
-         }
+//          if(pvals->point[l_idx].keyframe > l_affected_frames - 2)
+//          {
+//             l_err = g_strdup_printf(_("\nError: Keyframe %d at point [%d] higher or equal than last 
handled frame")
+//                                       , pvals->point[l_idx].keyframe_abs,  l_idx+1);
+//             l_err_lbltext = g_strdup_printf("%s%s", l_err_lbltext, l_err);
+//             g_free(l_err);
+//             l_errcount++;
+//          }
          if(pvals->point[l_idx].keyframe < l_prev_frame)
          {
             l_err = g_strdup_printf(_("\nError: Keyframe %d at point [%d] leaves not enough space (frames)"
@@ -3924,14 +3980,14 @@ gchar *gap_mov_exec_chk_keyframes(GapMovValues *pvals)
      }
   }
 
-  if(pvals->point_idx_max + 1 > l_affected_frames)
-  {
-        l_err = g_strdup_printf(_("\nError: More controlpoints (%d) than handled frames (%d)."
-                                  "\nPlease reduce controlpoints or select more frames"),
-                                  (int)pvals->point_idx_max+1, (int)l_affected_frames);
-        l_err_lbltext = g_strdup_printf("%s%s", l_err_lbltext, l_err);
-        g_free(l_err);
-  }
+//   if(pvals->point_idx_max + 1 > l_affected_frames)
+//   {
+//         l_err = g_strdup_printf(_("\nError: More controlpoints (%d) than handled frames (%d)."
+//                                   "\nPlease reduce controlpoints or select more frames"),
+//                                   (int)pvals->point_idx_max+1, (int)l_affected_frames);
+//         l_err_lbltext = g_strdup_printf("%s%s", l_err_lbltext, l_err);
+//         g_free(l_err);
+//   }
 
   return(l_err_lbltext);
 }       /* end gap_mov_exec_chk_keyframes */
@@ -4390,20 +4446,18 @@ gap_mov_exec_free_GapMovValues(GapMovValues *pvals)
 
 
 /* ------------------------------------------
- * gap_mov_exec_copy_GapMovValues
+ * gap_mov_exec_copy_xml_GapMovValues
  * ------------------------------------------
- * copies all settings inclusive the controlpoint table,
+ * copies settings from xml file inclusive the controlpoint table,
  */
-void
-gap_mov_exec_copy_GapMovValues(GapMovValues *dstValues, GapMovValues *srcValues)
+void gap_mov_exec_copy_xml_GapMovValues(GapMovValues *dstValues, GapMovValues *srcValues)
 {
   gint ii;
 
   if(gap_debug)
   {
-    printf("gap_mov_exec_copy_GapMovValues START\n");
+    printf("gap_mov_exec_copy_xml_GapMovValues START\n");
   }
-
   /* redim the point table in dstValues to same size as the srcValues */
   gap_mov_exec_dim_point_table(dstValues, srcValues->point_table_size);
 
@@ -4414,8 +4468,6 @@ gap_mov_exec_copy_GapMovValues(GapMovValues *dstValues, GapMovValues *srcValues)
   dstValues->recordedObjHeight = srcValues->recordedObjHeight;
   dstValues->total_frames = srcValues->total_frames;
   dstValues->src_layerstack = srcValues->src_layerstack;
-  dstValues->src_image_id = srcValues->src_image_id;
-  dstValues->src_layer_id = srcValues->src_layer_id;
   dstValues->src_handle = srcValues->src_handle;
   dstValues->src_stepmode = srcValues->src_stepmode;
   dstValues->src_selmode = srcValues->src_selmode;
@@ -4423,8 +4475,6 @@ gap_mov_exec_copy_GapMovValues(GapMovValues *dstValues, GapMovValues *srcValues)
   dstValues->src_force_visible = srcValues->src_force_visible;
   dstValues->src_apply_bluebox = srcValues->src_apply_bluebox;
   dstValues->clip_to_img = srcValues->clip_to_img;
-  dstValues->tmpsel_image_id = srcValues->tmpsel_image_id;
-  dstValues->tmpsel_channel_id = srcValues->tmpsel_channel_id;
 
   
   dstValues->step_speed_factor = srcValues->step_speed_factor;
@@ -4450,31 +4500,6 @@ gap_mov_exec_copy_GapMovValues(GapMovValues *dstValues, GapMovValues *srcValues)
   dstValues->dst_range_end = srcValues->dst_range_end;
   dstValues->dst_layerstack = srcValues->dst_layerstack;
 
-
-
-
-  dstValues->dst_image_id = srcValues->dst_image_id;
-  dstValues->tmp_image_id = srcValues->tmp_image_id;
-  dstValues->tmp_alt_image_id = srcValues->tmp_alt_image_id;
-  dstValues->tmp_alt_framenr = srcValues->tmp_alt_framenr;
-  
-  /*
-   *  NOT copied are apv values for animated preview 
-   *    apv_gap_paste_buff
-   */ 
-  dstValues->apv_mode = srcValues->apv_mode;
-  dstValues->apv_mlayer_image = srcValues->apv_mlayer_image;
-  dstValues->apv_framerate = srcValues->apv_framerate;
-  dstValues->apv_scalex = srcValues->apv_scalex;
-  dstValues->apv_scaley = srcValues->apv_scaley;
-
-  dstValues->tween_image_id = srcValues->tween_image_id;
-  dstValues->tween_layer_id = srcValues->tween_layer_id;
-  dstValues->trace_image_id = srcValues->trace_image_id;
-  dstValues->trace_layer_id = srcValues->trace_layer_id;
-  dstValues->twix = srcValues->twix;
-
-
   dstValues->rotate_threshold = srcValues->rotate_threshold;
 
   if(dstValues->dst_group_name_path_string != NULL)
@@ -4549,6 +4574,53 @@ gap_mov_exec_copy_GapMovValues(GapMovValues *dstValues, GapMovValues *srcValues)
     memcpy(dstValues->bbp_pv, srcValues->bbp_pv, sizeof(GapBlueboxGlobalParams));
   }
 
+}  /* end gap_mov_exec_copy_xml_GapMovValues */
+
+
+/* ------------------------------------------
+ * gap_mov_exec_copy_GapMovValues
+ * ------------------------------------------
+ * copies all settings inclusive the controlpoint table,
+ */
+void
+gap_mov_exec_copy_GapMovValues(GapMovValues *dstValues, GapMovValues *srcValues)
+{
+  if(gap_debug)
+  {
+    printf("gap_mov_exec_copy_GapMovValues START\n");
+  }
+  
+  gap_mov_exec_copy_xml_GapMovValues(dstValues, srcValues);
+
+  dstValues->src_image_id = srcValues->src_image_id;
+  dstValues->src_layer_id = srcValues->src_layer_id;
+
+  dstValues->tmpsel_image_id = srcValues->tmpsel_image_id;
+  dstValues->tmpsel_channel_id = srcValues->tmpsel_channel_id;
+
+  dstValues->dst_image_id = srcValues->dst_image_id;
+  dstValues->tmp_image_id = srcValues->tmp_image_id;
+  dstValues->tmp_alt_image_id = srcValues->tmp_alt_image_id;
+  dstValues->tmp_alt_framenr = srcValues->tmp_alt_framenr;
+
+  /*
+   *  NOT copied are apv values for animated preview 
+   *    apv_gap_paste_buff
+   */ 
+  dstValues->apv_mode = srcValues->apv_mode;
+  dstValues->apv_mlayer_image = srcValues->apv_mlayer_image;
+  dstValues->apv_framerate = srcValues->apv_framerate;
+  dstValues->apv_scalex = srcValues->apv_scalex;
+  dstValues->apv_scaley = srcValues->apv_scaley;
+
+  
+
+  dstValues->tween_image_id = srcValues->tween_image_id;
+  dstValues->tween_layer_id = srcValues->tween_layer_id;
+  dstValues->trace_image_id = srcValues->trace_image_id;
+  dstValues->trace_layer_id = srcValues->trace_layer_id;
+  dstValues->twix = srcValues->twix;
+
 
   /* copy cached rferences */
   p_dup_cache_GapMovValues(dstValues, srcValues);
@@ -4761,6 +4833,11 @@ void
 gap_mov_exec_dim_point_table(GapMovValues *pvals, gint num_points)
 {
    GapMovPoint *new_points;
+ 
+   if(gap_debug)
+   {
+     printf("gap_mov_exec_dim_point_table START\n");
+   }
    
    if(pvals->point != NULL)
    {
@@ -4808,5 +4885,3 @@ gap_mov_exec_dim_point_table(GapMovValues *pvals, gint num_points)
        );
    }
 }  /* end gap_mov_exec_dim_point_table */
-
-
diff --git a/gap/gap_mov_exec.h b/gap/gap_mov_exec.h
index f8d0f3c..7b3778d 100644
--- a/gap/gap_mov_exec.h
+++ b/gap/gap_mov_exec.h
@@ -61,6 +61,7 @@ gdouble gap_mov_exec_get_default_rotate_threshold();
 GapMovValues *gap_mov_exec_new_GapMovValues();
 void gap_mov_exec_free_GapMovValues(GapMovValues *pvals);
 void gap_mov_exec_copy_GapMovValues(GapMovValues *dstValues, GapMovValues *srcValues);
+void gap_mov_exec_copy_xml_GapMovValues(GapMovValues *dstValues, GapMovValues *srcValues);
 
 gboolean  gap_mov_exec_check_valid_xml_paramfile(const char *filename);
 
diff --git a/gap/gap_mov_main.c b/gap/gap_mov_main.c
index dec29eb..4351b83 100644
--- a/gap/gap_mov_main.c
+++ b/gap/gap_mov_main.c
@@ -237,7 +237,7 @@ GimpPlugInInfo PLUG_IN_INFO =
     {GIMP_PDB_INT32,        "run_mode",      "non-interactive"},
     {GIMP_PDB_IMAGE,        "dst_image",     "Destination image (one of the video frames), where to insert 
the animated source layers"},
     {GIMP_PDB_DRAWABLE,     "drawable",      "drawable to be transfromed and moved according to current 
phase"},
-    {GIMP_PDB_INT32,        "frame_phase",   "current frame nr starting at 1 (e.g. phase of movent and 
transformation along path)"},
+    {GIMP_PDB_INT32,        "frame_phase",   "current frame nr starting at 1 (i.e. phase of movent and 
transformation along path)"},
     {GIMP_PDB_INT32,        "total_frames",  "number of frames for the full movement/transformation. (value 
0 uses the recorded number of frames from the xml file)"},
     {GIMP_PDB_STRING,       "xml_paramfile", "a file with move path parameter settings in XML format "},
   };
@@ -710,3 +710,4 @@ run (const gchar *name
  /* remove LOCK on this image for all gap_plugins */
  gap_lock_remove_lock(lock_image_id);
 }
+
diff --git a/gap/gap_mov_render.c b/gap/gap_mov_render.c
index 4a1a98a..79048cc 100644
--- a/gap/gap_mov_render.c
+++ b/gap/gap_mov_render.c
@@ -565,8 +565,8 @@ p_mov_calculate_scale_factors(gint32 image_id, GapMovValues *val_ptr, GapMovCurr
     gdouble preScaleWidthFactor;
     gdouble preScaleHeightFactor;
 
-    gdouble result_width;         /* resulting width at unscaled size (e.g. 100%) */
-    gdouble result_height;        /* resulting height at unscaled size (e.g. 100%) */
+    gdouble result_width;         /* resulting width at unscaled size (that is 100%) */
+    gdouble result_height;        /* resulting height at unscaled size (that is 100%) */
     gdouble origWidth;
     gdouble origHeight;
 
diff --git a/gap/gap_mov_xml_par.c b/gap/gap_mov_xml_par.c
index 2019b86..47efb52 100644
--- a/gap/gap_mov_xml_par.c
+++ b/gap/gap_mov_xml_par.c
@@ -893,12 +893,12 @@ p_set_load_defaults_for_one_controlpoint(GapMovValues *pvals, gint idx)
     pvals->point[idx].keyframe = 0;   /* 0: controlpoint is not fixed to keyframe */
     pvals->point[idx].keyframe_abs = 0;   /* 0: controlpoint is not fixed to keyframe */
 
-    pvals->point[idx].accPosition = 0;           /* 0: linear (e.g NO acceleration) is default */
-    pvals->point[idx].accOpacity = 0;            /* 0: linear (e.g NO acceleration) is default */
-    pvals->point[idx].accSize = 0;               /* 0: linear (e.g NO acceleration) is default */
-    pvals->point[idx].accRotation = 0;           /* 0: linear (e.g NO acceleration) is default */
-    pvals->point[idx].accPerspective = 0;        /* 0: linear (e.g NO acceleration) is default */
-    pvals->point[idx].accSelFeatherRadius = 0;   /* 0: linear (e.g NO acceleration) is default */
+    pvals->point[idx].accPosition = 0;           /* 0: linear (NO acceleration) is default */
+    pvals->point[idx].accOpacity = 0;            /* 0: linear (NO acceleration) is default */
+    pvals->point[idx].accSize = 0;               /* 0: linear (NO acceleration) is default */
+    pvals->point[idx].accRotation = 0;           /* 0: linear (NO acceleration) is default */
+    pvals->point[idx].accPerspective = 0;        /* 0: linear (NO acceleration) is default */
+    pvals->point[idx].accSelFeatherRadius = 0;   /* 0: linear (NO acceleration) is default */
 
   }
 
@@ -1195,10 +1195,10 @@ p_copy_transformed_values(GapMovValues *dstValues, GapMovValues *srcValues
     printf("p_copy_transformed_values START\n");
   }
 
-  /* copy all settings, points (this also includes 
+  /* copy all settings, points that come from the xml file (this also includes 
    * reallocate the point table in dstValues to same size as the srcValues 
    */
-  gap_mov_exec_copy_GapMovValues(dstValues, srcValues);
+  gap_mov_exec_copy_xml_GapMovValues(dstValues, srcValues);
 
 
   /* transform coordinates */
@@ -1306,8 +1306,6 @@ gap_mov_xml_par_load(const char *filename, GapMovValues *productiveValues
   userDataPtr = g_new(GapMovXmlUserData, 1);
   userDataPtr->pvals = tmpValues;
 
-  ///p_init_default_values(tmpValues);   /// (?) TODO
-
   userDataPtr->isScopeValid = FALSE;
   userDataPtr->isParseOk = TRUE;
   userDataPtr->errorLineNumber = 0;
diff --git a/gap/gap_navigator_dialog.c b/gap/gap_navigator_dialog.c
index ce5e6a8..70f3a40 100644
--- a/gap/gap_navigator_dialog.c
+++ b/gap/gap_navigator_dialog.c
@@ -570,14 +570,12 @@ run(const gchar *name
   static GimpParam values[2];
   GimpRunMode run_mode;
   GimpPDBStatusType status = GIMP_PDB_SUCCESS;
-  gint32     nr;
   pid_t  l_navid_pid;
 
   gint32     l_rc;
 
   *nreturn_vals = 1;
   *return_vals = values;
-  nr = 0;
   l_rc = 0;
 
   INIT_I18N();
@@ -2529,8 +2527,8 @@ navi_render_preview (FrameWidget *fw)
          {
            if(gap_debug)
            {
-             printf("  CHECK SIZE old pv_area_data: %d  pv_w: %d pv_h:%d  filename:%s timestamp:%d\n"
-                               , (int)fw->pv_ptr->pv_area_data
+             printf("  CHECK SIZE old pv_area_data: %ld  pv_w: %d pv_h:%d  filename:%s timestamp:%d\n"
+                               , (long)fw->pv_ptr->pv_area_data
                                , (int)fw->pv_ptr->pv_width
                                , (int)fw->pv_ptr->pv_height
                                , fw->frame_filename
@@ -2679,7 +2677,7 @@ frame_widget_preview_events (GtkWidget *widget,
                              GdkEvent  *event,
                              gpointer  user_data)
 {
-  GdkEventExpose *eevent;
+  /* GdkEventExpose *eevent; */
   GdkEventButton *bevent;
   FrameWidget *fw;
   /* int sx, sy, dx, dy, w, h; */
@@ -2710,11 +2708,11 @@ frame_widget_preview_events (GtkWidget *widget,
     case GDK_BUTTON_PRESS:
       bevent = (GdkEventButton *) event;
 
-      if(gap_debug) printf("frame_widget_preview_events GDK_BUTTON_PRESS button:%d frame_nr:%d widget:%d  
da_wgt:%d\n"
+      if(gap_debug) printf("frame_widget_preview_events GDK_BUTTON_PRESS button:%d frame_nr:%d widget:%ld  
da_wgt:%ld\n"
                               , (int)bevent->button
                               , (int)fw->frame_nr
-                              , (int)widget
-                              , (int)fw->pv_ptr->da_widget
+                              , (long)widget
+                              , (long)fw->pv_ptr->da_widget
                               );
       if(fw->frame_nr < 0)
       {
@@ -2765,13 +2763,13 @@ frame_widget_preview_events (GtkWidget *widget,
       break;
 
     case GDK_EXPOSE:
-      if(gap_debug) printf("frame_widget_preview_events GDK_EXPOSE frame_nr:%d widget:%d  da_wgt:%d\n"
+      if(gap_debug) printf("frame_widget_preview_events GDK_EXPOSE frame_nr:%d widget:%ld  da_wgt:%ld\n"
                               , (int)fw->frame_nr
-                              , (int)widget
-                              , (int)fw->pv_ptr->da_widget
+                              , (long)widget
+                              , (long)fw->pv_ptr->da_widget
                               );
 
-      eevent = (GdkEventExpose *) event;
+      /* eevent = (GdkEventExpose *) event; */
 
       if(widget == fw->pv_ptr->da_widget)
       {
@@ -2879,12 +2877,12 @@ static void
 navi_dialog_update(gint32 update_flag)
 {
   gint32 l_first, l_last;
-  gint   l_image_menu_was_changed;
+  /* gint   l_image_menu_was_changed; */
 
-  l_image_menu_was_changed = FALSE;
+  /*  l_image_menu_was_changed = FALSE; */
   if(update_flag & NUPD_IMAGE_MENU)
   {
-    l_image_menu_was_changed = navi_refresh_image_menu();
+    /* l_image_menu_was_changed = */ navi_refresh_image_menu();
   }
   if(update_flag & NUPD_FRAME_NR_CHANGED)
   {
@@ -3068,7 +3066,11 @@ navi_frame_widget_time_label_update(FrameWidget *fw)
     frame_nr_to_time[1] = '\0';
   }
 
-  if(gap_debug) printf("navi_frame_widget_time_label_update: GTK_STYLE_SET_BACKGROUND bg_color: %d\n", 
(int)bg_color);
+  if(gap_debug)
+  {
+    printf("navi_frame_widget_time_label_update: GTK_STYLE_SET_BACKGROUND bg_color: %ld\n"
+       , (long)bg_color);
+  }
 
   /* Note: Gtk does not know about selcted items, since selections are handled
    * external by gap_navigator_dialog code.
diff --git a/gap/gap_onion_base.c b/gap/gap_onion_base.c
index 943afd8..3da67bc 100644
--- a/gap/gap_onion_base.c
+++ b/gap/gap_onion_base.c
@@ -688,7 +688,6 @@ gap_onion_base_image_duplicate(gint32 image_id)
     gint        l_idx;
     gint        l_is_onion;
     gint32      l_layer_id;
-    gboolean    l_has_onion;
 
     l_layers_list = gimp_image_get_layers(image_id, &l_nlayers);
     l_dup_layers_list = gimp_image_get_layers(dup_image_id, &l_dup_nlayers);
diff --git a/gap/gap_onion_dialog.c b/gap/gap_onion_dialog.c
index b8c84c8..0d1949a 100644
--- a/gap/gap_onion_dialog.c
+++ b/gap/gap_onion_dialog.c
@@ -554,7 +554,10 @@ static void
 on_oni__button_default_clicked         (GtkButton       *button,
                                         GapOnionMainGlobalParams *gpp)
 {
- if(gap_debug) printf("CB: on_oni__button_default_clicked gpp: %d\n", (int)gpp);
+ if(gap_debug)
+ {
+   printf("CB: on_oni__button_default_clicked gpp: %ld\n", (long)gpp);
+ }
 
  if(gpp)
  {
@@ -567,7 +570,10 @@ static void
 on_oni__button_help_clicked         (GtkButton       *button,
                                      GapOnionMainGlobalParams *gpp)
 {
- if(gap_debug) printf("CB: on_oni__button_help_clicked gpp: %d\n", (int)gpp);
+ if(gap_debug)
+ {
+   printf("CB: on_oni__button_help_clicked gpp: %ld\n", (long)gpp);
+ }
 
  if(gpp)
  {
diff --git a/gap/gap_onion_main.c b/gap/gap_onion_main.c
index 8781f1c..af6bae4 100644
--- a/gap/gap_onion_main.c
+++ b/gap/gap_onion_main.c
@@ -202,12 +202,8 @@ query ()
                          args_onion_visi, return_vals);
   {
      /* Menu names */
-     const char *menupath_image_video = N_("<Image>/Video/");
      const char *menupath_image_video_onionskin = N_("<Image>/Video/Onionskin/");
  
-     //gimp_plugin_menu_branch_register("<Image>", "Video");
-     //gimp_plugin_menu_branch_register("<Image>/Video", "Onionskin");
-
      gimp_plugin_menu_register (GAP_PLUGIN_NAME_ONION_CFG, menupath_image_video_onionskin);
      gimp_plugin_menu_register (GAP_PLUGIN_NAME_ONION_APPLY, menupath_image_video_onionskin);
      gimp_plugin_menu_register (GAP_PLUGIN_NAME_ONION_DEL, menupath_image_video_onionskin);
diff --git a/gap/gap_pdb_calls.c b/gap/gap_pdb_calls.c
index 225a21d..78f6e6c 100644
--- a/gap/gap_pdb_calls.c
+++ b/gap/gap_pdb_calls.c
@@ -113,7 +113,7 @@ gap_pdb_procedure_name_available (const gchar *search_name)
       {
         for (loop = 0; loop < num_procs; loop++)
         {
-          printf("PDBname:%s\t\search_name:%s\n", proc_list[loop], search_name);
+          printf("PDBname:%s\t search_name:%s\n", proc_list[loop], search_name);
         }
       }
 
@@ -158,9 +158,6 @@ gap_pdb_procedure_available(char *proc_name)
   gchar            *l_proc_date;
   GimpParamDef    *l_params;
   GimpParamDef    *l_return_vals;
-  gint             l_rc;
-
-  l_rc = 0;
   
   /* Query the gimp application's procedural database
    *  regarding a particular procedure.
@@ -348,8 +345,8 @@ workaround:
       {
          if(gap_debug)
          {
-           printf("(PDB_WRAPPER workaround for gimp_image_thumbnail GIMP_PDB_SUCCESS, th_data:%d  (%d x %d) 
\n"
-            , (int)return_vals[5].data.d_int8array
+           printf("(PDB_WRAPPER workaround for gimp_image_thumbnail GIMP_PDB_SUCCESS, th_data:%ld  (%d x %d) 
\n"
+            , (long)return_vals[5].data.d_int8array
             , (int)return_vals[1].data.d_int32
             , (int)return_vals[2].data.d_int32
             );
diff --git a/gap/gap_pixelrgn.c b/gap/gap_pixelrgn.c
index 2f08ce8..361bff8 100644
--- a/gap/gap_pixelrgn.c
+++ b/gap/gap_pixelrgn.c
@@ -63,7 +63,7 @@ struct _GimpPixelRgnIterator
  * This function cleans up by unref tiles that were initialized in a
  * loop constuct with gimp_pixel_rgns_register and gimp_pixel_rgns_process calls.
  * It is intended for clean escape from such a loop at early time
- * e.g. before all tiles are processed.
+ * i.e. before all tiles are processed.
  *
  * Note: leaving such a loop construct with break or return
  *        without clean up keeps tile references alive
@@ -95,7 +95,7 @@ gap_gimp_pixel_rgns_unref (gpointer pri_ptr)
   GimpPixelRgnIterator *pri;
   GSList               *list;
 
-  g_return_val_if_fail (pri_ptr != NULL, NULL);
+  g_return_if_fail (pri_ptr != NULL);
 
   pri = (GimpPixelRgnIterator*) pri_ptr;
   pri->process_count++;
diff --git a/gap/gap_player_cache.c b/gap/gap_player_cache.c
index 3fd8b75..8e8fc3f 100644
--- a/gap/gap_player_cache.c
+++ b/gap/gap_player_cache.c
@@ -172,7 +172,7 @@ p_get_admin_ptr(void)
                                                          );
     if(gap_debug)
     {
-      printf("p_get_admin_ptr: %d\n", (int)global_pca_ptr);
+      printf("p_get_admin_ptr: %ld\n", (long)global_pca_ptr);
     }
   }
   return (global_pca_ptr);
@@ -185,10 +185,10 @@ p_get_admin_ptr(void)
 static void
 p_debug_printf_cdata(GapPlayerCacheData *cdata)
 {
-    printf("  cdata  compression: %d, size:%d, th_data:%d, width:%d, height:%d, bpp:%d\n"
+    printf("  cdata  compression: %d, size:%d, th_data:%ld, width:%d, height:%d, bpp:%d\n"
              , (int)cdata->compression
              , (int)cdata->th_data_size
-             , (int)cdata->th_data
+             , (long)cdata->th_data
              , (int)cdata->th_width
              , (int)cdata->th_height
              , (int)cdata->th_bpp
@@ -206,9 +206,9 @@ p_debug_printf_cache_list(GapPlayerCacheAdmin *admin_ptr)
   GapPlayerCacheElem *prev_elem_ptr;
   gint ii;
 
-  printf("\np_debug_printf_cache_list: START start_elem:%d, end_elem:%d\n"
-    ,(int)admin_ptr->start_elem
-    ,(int)admin_ptr->end_elem
+  printf("\np_debug_printf_cache_list: START start_elem:%ld, end_elem:%ld\n"
+    ,(long)admin_ptr->start_elem
+    ,(long)admin_ptr->end_elem
     );
 
   ii = 0;
@@ -216,12 +216,12 @@ p_debug_printf_cache_list(GapPlayerCacheAdmin *admin_ptr)
   elem_ptr = admin_ptr->start_elem;
   while(elem_ptr != NULL)
   {
-    printf("elem_ptr[%03d]: %d ckey: <%s> prev:%d next:%d\n"
+    printf("elem_ptr[%03d]: %ld ckey: <%s> prev:%ld next:%ld\n"
              , (int)ii
-             , (int)elem_ptr
+             , (long)elem_ptr
              , elem_ptr->ckey
-             , (int)elem_ptr->prev
-             , (int)elem_ptr->next
+             , (long)elem_ptr->prev
+             , (long)elem_ptr->next
              );
     ii++;
 
@@ -526,7 +526,7 @@ gap_player_cache_free_all(void)
 
   if(gap_debug)
   {
-    printf("gap_player_cache_free_all: %d\n", (int)admin_ptr);
+    printf("gap_player_cache_free_all: %ld\n", (long)admin_ptr);
   }
 
   if(admin_ptr)
@@ -584,8 +584,8 @@ p_player_cache_remove_oldest_frame(GapPlayerCacheAdmin *admin_ptr)
   {
      if(gap_debug)
      {
-       printf("p_player_cache_remove_oldest_frame: delete_elem_ptr: %d ckey: <%s> \n"
-             , (int)delete_elem_ptr
+       printf("p_player_cache_remove_oldest_frame: delete_elem_ptr: %ld ckey: <%s> \n"
+             , (long)delete_elem_ptr
              ,delete_elem_ptr->ckey
              );
      }
@@ -627,10 +627,10 @@ p_free_elem(GapPlayerCacheElem  *delete_elem_ptr)
 
   if(gap_debug)
   {
-    printf("p_free_elem: delete_elem_ptr: %d, ckey: %d, cdata:%d"
-      ,(int)delete_elem_ptr
-      ,(int)delete_elem_ptr->ckey
-      ,(int)delete_elem_ptr->cdata
+    printf("p_free_elem: delete_elem_ptr: %ld, ckey: %ld, cdata:%ld"
+      ,(long)delete_elem_ptr
+      ,(long)delete_elem_ptr->ckey
+      ,(long)delete_elem_ptr->cdata
       );
     if(delete_elem_ptr->ckey)
     {
@@ -831,10 +831,10 @@ gap_player_cache_decompress(GapPlayerCacheData *cdata)
     memcpy(th_data, cdata->th_data, cdata->th_data_size);
     if(gap_debug)
     {
-      printf("gap_player_cache_decompress: th_data:%d size:%d, cdata->th_data: %d\n"
-        , (int)th_data
+      printf("gap_player_cache_decompress: th_data:%ld size:%d, cdata->th_data: %ld\n"
+        , (long)th_data
         , (int)cdata->th_data_size
-        , (int)cdata->th_data
+        , (long)cdata->th_data
         );
     }
   }
diff --git a/gap/gap_player_dialog.c b/gap/gap_player_dialog.c
index 03ffb4c..30bf0aa 100644
--- a/gap/gap_player_dialog.c
+++ b/gap/gap_player_dialog.c
@@ -1511,7 +1511,7 @@ p_mtrace_pixbuf( GapPlayerMainGlobalParams *gpp
     if(pixbuf)
     {
       gint32 nchannels;
-      gint32 rowstride;
+      //gint32 rowstride;
       gint32 width;
       gint32 height;
       guchar *pix_data;
@@ -1520,7 +1520,7 @@ p_mtrace_pixbuf( GapPlayerMainGlobalParams *gpp
       height = gdk_pixbuf_get_height(pixbuf);
       nchannels = gdk_pixbuf_get_n_channels(pixbuf);
       pix_data = gdk_pixbuf_get_pixels(pixbuf);
-      rowstride = gdk_pixbuf_get_rowstride(pixbuf);
+      //rowstride = gdk_pixbuf_get_rowstride(pixbuf);
 
       p_mtrace_tmpbuf(gpp
                    , pix_data
@@ -1643,9 +1643,9 @@ p_update_ainfo_for_videofile(GapPlayerMainGlobalParams *gpp)
 #ifdef GAP_ENABLE_VIDEOAPI_SUPPORT
   if(gap_debug)
   {
-    printf("p_update_ainfo_for_videofile  gpp->ainfo_ptr:%d gpp->gvahand:%d\n"
-      , (int)gpp->ainfo_ptr
-      , (int)gpp->gvahand
+    printf("p_update_ainfo_for_videofile  gpp->ainfo_ptr:%ld gpp->gvahand:%ld\n"
+      , (long)gpp->ainfo_ptr
+      , (long)gpp->gvahand
       );
   }
 
@@ -2454,7 +2454,7 @@ on_audio_otone_extract_button_clicked (GtkButton       *button,
   gboolean    l_otone_is_up_to_date;
   gint32      l_extract_audiotrack;
   gint32      l_begin_frame_nr;
-  gint32      l_end_frame_nr;
+  //gint32      l_end_frame_nr;
   char       *l_audiofilename;
   char       *l_audiofilename_cancel;
 
@@ -2522,7 +2522,7 @@ on_audio_otone_extract_button_clicked (GtkButton       *button,
   {
     gdouble l_dbl_total_frames;
     l_begin_frame_nr = 1;
-    l_end_frame_nr = gpp->gvahand->total_frames;
+    //l_end_frame_nr = gpp->gvahand->total_frames;
     l_dbl_total_frames = (gdouble)gpp->gvahand->total_frames;
 
     p_msg_progress_bar_audio(gpp, _("extracting audio"));
@@ -3494,9 +3494,9 @@ p_open_composite_storyboard(GapPlayerMainGlobalParams *gpp)
 
   if(gap_debug)
   {
-    printf("p_open_composite_storyboard: %s comp_vidhand:%d type:%d(%d) id:%d(%d)\n"
+    printf("p_open_composite_storyboard: %s comp_vidhand:%ld type:%d(%d) id:%d(%d)\n"
         ,gpp->stb_ptr->storyboardfile
-        ,(int)gpp->stb_comp_vidhand
+        ,(long)gpp->stb_comp_vidhand
         ,(int)gpp->stb_ptr->stb_parttype
         ,(int)gpp->stb_parttype
         ,(int)gpp->stb_ptr->stb_unique_id
@@ -3569,8 +3569,8 @@ p_fetch_composite_image(GapPlayerMainGlobalParams *gpp
                                );
        if(gap_debug)
        {
-         printf("p_fetch_composite_image: comp_vidhand:%d  composite_image_id:%d\n"
-             ,(int)gpp->stb_comp_vidhand
+         printf("p_fetch_composite_image: comp_vidhand:%ld  composite_image_id:%d\n"
+             ,(long)gpp->stb_comp_vidhand
              ,(int)composite_image_id
              );
        }
@@ -3769,8 +3769,8 @@ p_fetch_display_composite_image_from_storyboard(GapPlayerMainGlobalParams *gpp
               );
     if(gap_debug)
     {
-      printf("COMPOSITE thdata:%d ckey: %s\n"
-             ,(int)l_th_data
+      printf("COMPOSITE thdata:%ld ckey: %s\n"
+             ,(long)l_th_data
              ,*ckey_pptr
              );
     }
@@ -4383,10 +4383,15 @@ p_display_frame(GapPlayerMainGlobalParams *gpp, gint32 framenr)
 
   gdk_flush();
 
-  if(l_th_data)  g_free(l_th_data);
-
-  if(l_filename) g_free(l_filename);
+  if(l_th_data)
+  {
+    g_free(l_th_data);
+  }
 
+  if(l_filename)
+  {
+    g_free(l_filename);
+  }
   GAP_TIMM_STOP_FUNCTION(funcId);
 
 }  /* end p_display_frame */
@@ -5426,7 +5431,7 @@ on_framenr_button_clicked             (GtkButton       *button,
 {
    GimpParam       *return_vals;
    int              nreturn_vals;
-   gint             button_type;
+   glong             button_type;
    gint32           dummy_layer_id;
 
   /*if(gap_debug) printf("on_framenr_button_clicked: START\n"); */
@@ -5440,7 +5445,7 @@ on_framenr_button_clicked             (GtkButton       *button,
 
   if(button)
   {
-    button_type = (gint) g_object_get_data (G_OBJECT (button), KEY_FRAMENR_BUTTON_TYPE);
+    button_type = (glong) g_object_get_data (G_OBJECT (button), KEY_FRAMENR_BUTTON_TYPE);
   }
   else
   {
@@ -9197,6 +9202,3 @@ gap_player_dlg_playback_dialog(GapPlayerMainGlobalParams *gpp)
 
 }  /* end gap_player_dlg_playback_dialog */
 
-
-
-
diff --git a/gap/gap_pview_da.c b/gap/gap_pview_da.c
index c5a7f84..8aa01fa 100644
--- a/gap/gap_pview_da.c
+++ b/gap/gap_pview_da.c
@@ -1324,7 +1324,7 @@ p_pixmap_data_destructor(gpointer data)
   if(gap_debug)
   {
     printf(" -- DESTRUCTOR p_pixmap_data_destructor called\n");
-    printf(" -- data: %d\n", (int)data);
+    printf(" -- data: %ld\n", (long)data);
   }
   g_free(data);
   
@@ -1427,8 +1427,7 @@ gap_pview_get_repaint_thdata(GapPView   *pv_ptr        /* IN */
                             , gboolean  *th_has_alpha  /* OUT */
                             )
 { 
-  int bits_per_sample;
-  int rowstride;
+  /* int bits_per_sample; */
   int width;
   int height;
   gboolean has_alpha;
@@ -1441,8 +1440,7 @@ gap_pview_get_repaint_thdata(GapPView   *pv_ptr        /* IN */
     return(NULL);
   }
 
-  bits_per_sample = 8;
-  rowstride = pv_ptr->pv_width * pv_ptr->pv_bpp;
+  /* bits_per_sample = 8; */
   has_alpha = FALSE;
   width = pv_ptr->pv_width;
   height = pv_ptr->pv_height;
@@ -1452,8 +1450,7 @@ gap_pview_get_repaint_thdata(GapPView   *pv_ptr        /* IN */
   && (pv_ptr->pixbuf))
   {
     pixel_data_src = gdk_pixbuf_get_pixels(pv_ptr->pixbuf);
-    rowstride = gdk_pixbuf_get_rowstride(pv_ptr->pixbuf);
-    bits_per_sample = gdk_pixbuf_get_bits_per_sample(pv_ptr->pixbuf);
+    /* bits_per_sample = gdk_pixbuf_get_bits_per_sample(pv_ptr->pixbuf); */
     has_alpha = gdk_pixbuf_get_has_alpha(pv_ptr->pixbuf);
   }
   
diff --git a/gap/gap_range_ops.c b/gap/gap_range_ops.c
index 00ec0e0..3c94a43 100644
--- a/gap/gap_range_ops.c
+++ b/gap/gap_range_ops.c
@@ -1226,13 +1226,15 @@ gint32 gap_range_to_multilayer(GimpRunMode run_mode, gint32 image_id,
          }
          g_snprintf(frame_basename, frame_basename_len, "frame_[######] (%dms)", (int)(1000/l_framerate));
          framerate = 0;
+         l_layersel_case    = layersel_case;
+         l_sel_invert       = sel_invert;
          l_rc = p_range_to_multilayer_dialog (ainfo_ptr, &l_from, &l_to,
                                 &flatten_mode, &bg_visible,
                                 &framerate, frame_basename, frame_basename_len,
                                 _("Frames to Image"),
                                 _("Create Multilayer-Image from Frames"),
-                                &l_layersel_mode, &layersel_case,
-                                &sel_invert, &l_sel_pattern[0],
+                                &l_layersel_mode, &l_layersel_case,
+                                &l_sel_invert, &l_sel_pattern[0],
                                 &l_selection_mode
                                 );
       }
@@ -1255,8 +1257,8 @@ gint32 gap_range_to_multilayer(GimpRunMode run_mode, gint32 image_id,
          new_image_id = p_frames_to_multilayer(ainfo_ptr, l_from, l_to,
                                                flatten_mode, bg_visible,
                                                framerate, frame_basename,
-                                               l_layersel_mode, layersel_case,
-                                               sel_invert, &l_sel_pattern[0],
+                                               l_layersel_mode, l_layersel_case,
+                                               l_sel_invert, &l_sel_pattern[0],
                                                l_selection_mode);
          gimp_display_new(new_image_id);
          l_rc = new_image_id;
@@ -1683,19 +1685,14 @@ p_anim_sizechange(GapAnimInfo *ainfo_ptr,
                long offs_x, long offs_y
 )
 {
-  guint   l_width, l_height;
   long    l_cur_frame_nr;
   long    l_step, l_begin, l_end;
   gint32  l_tmp_image_id;
   gdouble    l_percentage, l_percentage_step;
-  GimpParam     *l_params;
   int         l_rc;
   gboolean    l_frame_found;
 
   l_rc = 0;
-  l_params = NULL;
-
-
   l_percentage = 0.0;
   if(ainfo_ptr->run_mode == GIMP_RUN_INTERACTIVE)
   {
@@ -1715,10 +1712,6 @@ p_anim_sizechange(GapAnimInfo *ainfo_ptr,
 
 
   /* get info about the image (size and type is common to all frames) */
-  l_width  = gimp_image_width(ainfo_ptr->image_id);
-  l_height = gimp_image_height(ainfo_ptr->image_id);
-
-
   l_begin = ainfo_ptr->first_frame_nr;
   l_end   = ainfo_ptr->last_frame_nr;
 
diff --git a/gap/gap_stock.c b/gap/gap_stock.c
index 9de2db3..0d440df 100644
--- a/gap/gap_stock.c
+++ b/gap/gap_stock.c
@@ -86,11 +86,11 @@ add_stock_icon (const gchar  *stock_id,
 
   if(gap_debug)
   {
-    printf("add_stock_icon stock_id:%s size:%d inline_data:%d pixbuf:%d\n"
+    printf("add_stock_icon stock_id:%s size:%d inline_data:%ld pixbuf:%ld\n"
        ,stock_id
        ,(int)size
-       ,(int)inline_data
-       ,(int)pixbuf
+       ,(long)inline_data
+       ,(long)pixbuf
        );
   }
 
diff --git a/gap/gap_story_dialog.c b/gap/gap_story_dialog.c
index ca060e3..2c9520e 100644
--- a/gap/gap_story_dialog.c
+++ b/gap/gap_story_dialog.c
@@ -490,7 +490,8 @@ p_is_debug_menu_enabled(void)
  * p_is_debug_feature_item_enabled
  * ---------------------------------------
  * return TRUE if the specified debug_item name
- * is enabled (e.g. is present as text line in the debug configuration file)
+ * is enabled 
+ * (a debug_item name is enabled when it is present as text line in the debug configuration file)
  */
 static gboolean
 p_is_debug_feature_item_enabled(const char *debug_item)
@@ -962,8 +963,8 @@ p_render_all_frame_widgets (GapStbTabWidgets *tabw)
 
     if(gap_debug)
     {
-      printf("(3) p_render_all_frame_widgets fw: %d\n", (int)fw );
-      printf("(4) p_render_all_frame_widgets fw->frame_filename: %d\n", (int)&fw->frame_filename );
+      printf("(3) p_render_all_frame_widgets fw: %ld\n", (long)fw );
+      printf("(4) p_render_all_frame_widgets fw->frame_filename: %ld\n", (long)&fw->frame_filename );
     }
 
     if(fw->frame_filename)
@@ -1927,7 +1928,7 @@ p_story_call_player(GapStbMainGlobalParams *sgpp
         }
         else
         {
-          /* in case player was not yet called (e.g this ist the very 1st player call)
+          /* in case player was not yet called (i.e. this ist the very 1st player call)
            * the preview size is not yet known.
            * Assume a preview width of 320 pixel in that case
            */
@@ -2077,7 +2078,6 @@ p_call_master_encoder(GapStbMainGlobalParams *sgpp
 #define GAP_PLUG_IN_MASTER_ENCODER  "plug_in_gap_vid_encode_master"
   GimpParam* l_params;
   gint       l_retvals;
-  gint       l_rc;
   gint32     dummy_layer_id;
 
   gint32 vid_width;
@@ -2094,10 +2094,9 @@ p_call_master_encoder(GapStbMainGlobalParams *sgpp
     return;
   }
 
-  l_rc = -1;
   gap_story_get_master_size_respecting_aspect(stb, &vid_width, &vid_height);
 
-  gtk_window_iconify(sgpp->shell_window);
+  gtk_window_iconify(GTK_WINDOW(sgpp->shell_window));
   while (gtk_events_pending ())
   {
     gtk_main_iteration ();
@@ -2127,7 +2126,6 @@ p_call_master_encoder(GapStbMainGlobalParams *sgpp
   switch(l_params[0].data.d_status)
   {
     case GIMP_PDB_SUCCESS:
-      l_rc = 0;
       break;
     case GIMP_PDB_CANCEL:
       break;
@@ -2141,7 +2139,7 @@ p_call_master_encoder(GapStbMainGlobalParams *sgpp
       break;
   }
   g_free(l_params);
-  gtk_window_deiconify(sgpp->shell_window);
+  gtk_window_deiconify(GTK_WINDOW(sgpp->shell_window));
 
 }  /* end p_call_master_encoder */
 
@@ -3420,7 +3418,7 @@ p_cliptarget_togglebutton_toggled_cb (GtkToggleButton *togglebutton
 
  if(gap_debug)
  {
-   printf("CB: p_cliptarget_togglebutton_toggled_cb: %d\n", (int)togglebutton);
+   printf("CB: p_cliptarget_togglebutton_toggled_cb: %ld\n", (long)togglebutton);
  }
 
  if(clip_target_ptr)
@@ -3780,7 +3778,7 @@ p_frame_widget_preview_events_cb (GtkWidget *widget,
                              GdkEvent  *event,
                              GapStbFrameWidget *fw)
 {
-  GdkEventExpose *eevent;
+  //GdkEventExpose *eevent;
   GdkEventButton *bevent;
 
   if(fw == NULL)
@@ -3813,11 +3811,11 @@ p_frame_widget_preview_events_cb (GtkWidget *widget,
       bevent = (GdkEventButton *) event;
 
       gtk_widget_grab_focus (fw->vbox);
-      if(gap_debug) printf("p_frame_widget_preview_events_cb GDK_BUTTON_PRESS button:%d seq_nr:%d widget:%d  
da_wgt:%d\n"
+      if(gap_debug) printf("p_frame_widget_preview_events_cb GDK_BUTTON_PRESS button:%d seq_nr:%d widget:%ld 
 da_wgt:%ld\n"
                               , (int)bevent->button
                               , (int)fw->seq_nr
-                              , (int)widget
-                              , (int)fw->pv_ptr->da_widget
+                              , (long)widget
+                              , (long)fw->pv_ptr->da_widget
                               );
       if(fw->stb_elem_refptr == NULL)
       {
@@ -3856,13 +3854,13 @@ p_frame_widget_preview_events_cb (GtkWidget *widget,
       break;
 
     case GDK_EXPOSE:
-      if(gap_debug) printf("p_frame_widget_preview_events_cb GDK_EXPOSE seq_nr:%d widget:%d  da_wgt:%d\n"
+      if(gap_debug) printf("p_frame_widget_preview_events_cb GDK_EXPOSE seq_nr:%d widget:%ld  da_wgt:%ld\n"
                               , (int)fw->seq_nr
-                              , (int)widget
-                              , (int)fw->pv_ptr->da_widget
+                              , (long)widget
+                              , (long)fw->pv_ptr->da_widget
                               );
 
-      eevent = (GdkEventExpose *) event;
+      //eevent = (GdkEventExpose *) event;
 
       if(widget == fw->pv_ptr->da_widget)
       {
@@ -3964,8 +3962,8 @@ gap_story_dlg_spw_section_refresh(GapStbSecpropWidget *spw, GapStorySection *tar
   {
     if(target_section)
     {
-      printf("\ngap_story_dlg_spw_section_refresh\n  target_section: %d (id:%d)\n"
-         , (int)target_section
+      printf("\ngap_story_dlg_spw_section_refresh\n  target_section: %ld (id:%d)\n"
+         , (long)target_section
          , (int)target_section->section_id
          );
       if(target_section->section_name)
@@ -4451,7 +4449,11 @@ p_tabw_update_selection(GapStbTabWidgets  *tabw)
       }
     }
 
-    if(gap_debug) printf("p_tabw_update_selection: GTK_STYLE_SET_BACKGROUND bg_color: %d\n", (int)bg_color);
+    if(gap_debug)
+    {
+      printf("p_tabw_update_selection: GTK_STYLE_SET_BACKGROUND bg_color: %ld\n"
+         , (long)bg_color);
+    }
 
     /* Note: Gtk does not know about selcted items, since selections are handled
      * external by gap_navigator_dialog code.
@@ -4754,7 +4756,7 @@ p_tabw_sensibility (GapStbMainGlobalParams *sgpp
   if(tabw->new_clip_button) gtk_widget_set_sensitive(tabw->new_clip_button, l_sensitive_new);
 
 
-  /* handle video track sensitivity (not sensitive if stb is not present e.g. is NULL)  */
+  /* handle video track sensitivity (not sensitive if stb is not present i.e. is NULL)  */
   l_sensitive = FALSE;
   l_lower_limit = 0;
   l_upper_limit = GAP_STB_MAX_VID_TRACKS -1;
@@ -6963,7 +6965,7 @@ p_prefetch_vthumbs (GapStbMainGlobalParams *sgpp, GapStoryBoard *stb)
 {
   GapStorySection  *section;
   GapStoryElem     *stb_elem;
-  GapVThumbElem    *vthumb;
+  //GapVThumbElem    *vthumb;
   gint32         l_total;
   gint32         l_count;
 
@@ -6975,8 +6977,8 @@ p_prefetch_vthumbs (GapStbMainGlobalParams *sgpp, GapStoryBoard *stb)
 
   if(gap_debug)
   {
-    printf("p_prefetch_vthumbs : stb: %d\n"
-       ,(int)stb
+    printf("p_prefetch_vthumbs : stb: %ld\n"
+       ,(long)stb
        );
   }
 
@@ -7022,13 +7024,15 @@ p_prefetch_vthumbs (GapStbMainGlobalParams *sgpp, GapStoryBoard *stb)
 
         l_count++;
 
-        vthumb = gap_story_vthumb_elem_fetch(sgpp
+        /* vthumb = */ 
+        gap_story_vthumb_elem_fetch(sgpp
                     ,stb
                     ,stb_elem
                     ,stb_elem->from_frame
                     ,stb_elem->seltrack
                     ,gap_story_get_preferred_decoder(stb, stb_elem)
                     );
+        
         if(sgpp->progress_bar_master)
         {
 
@@ -7140,7 +7144,7 @@ p_optimized_prefetch_vthumbs (GapStbMainGlobalParams *sgpp)
     sgpp->cancel_video_api = FALSE;
     if(sgpp->auto_vthumb)
     {
-        gboolean option_restart;
+        //gboolean option_restart;
 
         refreshRequired = TRUE;
         recreateRequired = FALSE;
@@ -7159,7 +7163,7 @@ p_optimized_prefetch_vthumbs (GapStbMainGlobalParams *sgpp)
            *    (currently this attempt leads to crashes that i could not locate yet)
            * - the other (currently implemented) option is to cancel prefetch and implicitly turn off 
auto_vthumb mode
            */
-          option_restart = TRUE;
+          //option_restart = TRUE;
 
 
           if(gap_debug)
@@ -7272,7 +7276,10 @@ p_tabw_key_press_event_cb ( GtkWidget *widget
   GapStoryBoard *stb;
   GdkEventKey   *kevent;
 
-  if(gap_debug) printf("p_tabw_key_press_event_cb : tabw:%d\n", (int)tabw);
+  if(gap_debug)
+  {
+    printf("p_tabw_key_press_event_cb : tabw:%ld\n", (long)tabw);
+  }
 
   if(tabw == NULL)
   {
@@ -7415,9 +7422,9 @@ story_dlg_response (GtkWidget *widget,
 
   if(gap_debug)
   {
-    printf("story_dlg_response response_id:%d sgpp:%d\n"
+    printf("story_dlg_response response_id:%d sgpp:%ld\n"
        , (int)response_id
-       , (int)sgpp
+       , (long)sgpp
        );
   }
 
@@ -7518,7 +7525,13 @@ p_recreate_tab_widgets(GapStoryBoard *stb
                        ,GapStbMainGlobalParams *sgpp
                       )
 {
-  if(gap_debug) printf("p_recreate_tab_widgets:START stb:%d tabw:%d\n", (int)stb ,(int)tabw);
+  if(gap_debug)
+  {
+    printf("p_recreate_tab_widgets:START stb:%ld tabw:%ld\n"
+       , (long)stb 
+       , (long)tabw
+       );
+  }
 
   if(tabw)
   {
@@ -7811,14 +7824,14 @@ p_activate_section_by_combo_index(gint target_index
        }
        else
        {
-         printf("p_activate_section_by_combo_index: %d active_section: %d section:%d "
-            ,(int)target_index
-            , (int)section
-            , (int)stb_dst->active_section
+         printf("p_activate_section_by_combo_index: %d active_section: %ld section:%ld "
+            , (int)target_index
+            , (long)section
+            , (long)stb_dst->active_section
             );
          if (section->section_name == NULL)
          {
-           printf("section_name: NULL (e.g. MAIN)\n");
+           printf("section_name: NULL (refers to the MAIN section)\n");
          }
          else
          {
@@ -9560,8 +9573,8 @@ p_tabw_master_prop_dialog(GapStbTabWidgets *tabw, gboolean new_flag)
   gap_arr_arg_init(&argv[l_ii], GAP_ARR_WGT_FILESEL);
   argv[l_ii].label_txt = _("Ext. Transparency Format:");
   argv[l_ii].entry_width = 250;       /* pixel */
-  argv[l_ii].help_txt  = _("Format string to provide external tranparency in movie clips. "
-                           "(e.g automatic alpha channel insertation)"
+  argv[l_ii].help_txt  = _("Format string to provide external transparency in movie clips. "
+                           "(i.e. automatic alpha channel insertation via external frames)"
                            "this string shall contain \%s as placeholder for the basename of a videoclip and 
"
                            "optional \%06d as placeholder for the framenumber.");
   argv[l_ii].text_buf_len = sizeof(l_master_insert_alpha_format);
@@ -9581,7 +9594,7 @@ p_tabw_master_prop_dialog(GapStbTabWidgets *tabw, gboolean new_flag)
   gap_arr_arg_init(&argv[l_ii], GAP_ARR_WGT_FILESEL);
   argv[l_ii].label_txt = _("AreaFormat:");
   argv[l_ii].entry_width = 250;       /* pixel */
-  argv[l_ii].help_txt  = _("Format string for area replacement in movie clips. (e.g automatic logo insert)"
+  argv[l_ii].help_txt  = _("Format string for area replacement in movie clips. (for example automatic logo 
insert)"
                            "this string shall contain \%s as placeholder for the basename of a videoclip and 
"
                            "optional \%06d as placeholder for the framenumber.");
   argv[l_ii].text_buf_len = sizeof(l_master_insert_area_format);
@@ -9612,6 +9625,15 @@ p_tabw_master_prop_dialog(GapStbTabWidgets *tabw, gboolean new_flag)
   if((l_rc) && (sgpp->shell_window))
   {
      GapStoryBoard *stb_dup;
+     
+     if(gap_debug)
+     {
+       printf("Master Properties l_rc:%d, l_ii_aspect:%d l_ii_preferred_decoder:%d\n"
+          , (int)l_rc
+          , (int)l_ii_aspect
+          , (int)l_ii_preferred_decoder
+          );
+     }
 
 
      if(new_flag)
@@ -9806,7 +9828,7 @@ on_stb_elem_drag_begin (GtkWidget        *widget,
 
   if(gap_debug)
   {
-    printf("on_stb_elem_drag_begin FW:%d\n", (int)fw);
+    printf("on_stb_elem_drag_begin FW:%ld\n", (long)fw);
   }
   if (fw == NULL)                  { return; }
   if(fw->stb_elem_refptr == NULL)  { return; }
@@ -9854,7 +9876,7 @@ on_stb_elem_drag_get (GtkWidget        *widget,
 {
   if(gap_debug)
   {
-    printf("on_stb_elem_drag_get FW:%d, info:%d\n", (int)fw, (int)info);
+    printf("on_stb_elem_drag_get FW:%ld, info:%d\n", (long)fw, (int)info);
   }
   if (fw)
   {
@@ -9995,7 +10017,7 @@ on_clip_elements_dropped (GtkWidget        *widget,
         fw_drop = *fw_drop_ptr;
         if(gap_debug)
         {
-          printf("on_clip_elements_dropped FW_DROP:%d\n", (int)fw_drop);
+          printf("on_clip_elements_dropped FW_DROP:%ld\n", (long)fw_drop);
         }
         if (fw_drop == NULL)
         {
@@ -10110,15 +10132,15 @@ p_get_or_auto_create_storyboard (GapStbMainGlobalParams *sgpp
   l_stb = p_tabw_get_stb_ptr(tabw);
   if(gap_debug)
   {
-    printf("(STB_tabw:%d CLL_tabw:%d) TABW: %d\n"
-      , (int)sgpp->stb_widgets
-      , (int)sgpp->cll_widgets
-      , (int)tabw
+    printf("(STB_tabw:%ld CLL_tabw:%ld) TABW: %ld\n"
+      , (long)sgpp->stb_widgets
+      , (long)sgpp->cll_widgets
+      , (long)tabw
       );
-    printf("(stb:%d cll:%d)stb_dst: %d\n"
-      , (int)sgpp->stb
-      , (int)sgpp->cll
-      , (int)l_stb
+    printf("(stb:%ld cll:%ld)stb_dst: %ld\n"
+      , (long)sgpp->stb
+      , (long)sgpp->cll
+      , (long)l_stb
       );
   }
 
@@ -10471,7 +10493,13 @@ p_frame_widget_init_dnd(GapStbFrameWidget *fw)
   //g_signal_connect (widget, "drag_data_delete",
   //                 G_CALLBACK (on_stb_elem_drag_delete), fw);
 
-  if(gap_debug) printf("INIT FW:%d    fw->tabw:%d\n", (int)fw, (int)fw->tabw);
+  if(gap_debug)
+  {
+    printf("INIT FW:%ld    fw->tabw:%ld\n"
+       , (long)fw
+       , (long)fw->tabw
+       );
+  }
 
 }  /* end p_frame_widget_init_dnd */
 
@@ -10561,11 +10589,12 @@ p_call_external_image_viewer(GapStbFrameWidget *fw)
           imagename = gap_story_get_filename_from_elem(fw->stb_elem_refptr);
           externalImageViewer = p_get_external_image_viewer();
           externalImageViewerCall = g_strdup_printf("%s %s &"
-             ,p_get_external_image_viewer()
+             ,externalImageViewer
              ,imagename
              );
           system(externalImageViewerCall);
 
+          g_free(externalImageViewer);
           g_free(externalImageViewerCall);
           g_free(imagename);
         }
diff --git a/gap/gap_story_file.c b/gap/gap_story_file.c
index 8b91f62..c3d0067 100644
--- a/gap/gap_story_file.c
+++ b/gap/gap_story_file.c
@@ -2369,7 +2369,7 @@ gap_story_lists_merge(GapStoryBoard *stb_dst
     }
 
     /* insert regular clips (non-mask clips) to the active section in the
-     * destination storyboard. (e.g. paste explicte selected clips)
+     * destination storyboard. (i.e. paste explicte selected clips)
      */
     p_list_insert_at_story_id(stb_dst->active_section
                          , stb_vtrack_main_section
@@ -3004,7 +3004,7 @@ p_assign_parsed_video_values(GapStoryElem *stb_elem
  * p_assign_accel_attr
  * ------------------------------
  * assign acceleration characteristic for the transition attribute [ii]
- * if information is present (e.g accel_ptr is not null and points to a value)
+ * if information is present (where accel_ptr is not null and points to a value)
  */
 static void
 p_assign_accel_attr(GapStoryElem *stb_elem
@@ -6126,7 +6126,7 @@ gap_story_save(GapStoryBoard *stb, const char *filename)
       print_section_record = TRUE;
       if (section == stb->mask_section)
       {
-        /* mask definitions (e.g. all elements in the mask_section)
+        /* mask definitions (that are all elements in the mask_section)
          * were already handled separate, because they have other file syntax
          * than regular clip elements.
          */
@@ -8234,7 +8234,7 @@ gap_story_remove_sel_elems(GapStoryBoard *stb)
  * gap_story_is_active_element
  * -------------------------------
  * returns true on elements that are active video elements
- * (e.g. relevant to be visualized as thumbnail in the storyboard dialog)
+ * (that are relevant to be visualized as thumbnail in the storyboard dialog)
  */
 gboolean
 gap_story_is_active_element(GapStoryElem *stb_elem)
@@ -9061,7 +9061,7 @@ gap_story_get_default_attribute(gint att_typ_idx)
  * gap_story_file_calculate_render_attributes
  * ------------------------------------------
  * perform calculations for rendering a layer or image (specified by frame_width, frame_height)
- * onto a destination image (specified by vid_width, vid_height e.g. composite image size)
+ * onto a destination image (specified by vid_width, vid_height i.e. composite image size)
  *
  * according to storyboard attribute settings
  * (specified by
diff --git a/gap/gap_story_properties.c b/gap/gap_story_properties.c
index 5347329..17f262a 100644
--- a/gap/gap_story_properties.c
+++ b/gap/gap_story_properties.c
@@ -1357,8 +1357,8 @@ p_pw_preview_events_cb (GtkWidget *widget
                        , GdkEvent  *event
                        , GapStbPropWidget *pw)
 {
-  GdkEventExpose *eevent;
-  GdkEventButton *bevent;
+  /*GdkEventExpose *eevent;*/
+  /*GdkEventButton *bevent;*/
   GapStbMainGlobalParams  *sgpp;
 
   if ((pw->stb_elem_refptr == NULL)
@@ -1372,7 +1372,7 @@ p_pw_preview_events_cb (GtkWidget *widget
   switch (event->type)
   {
     case GDK_BUTTON_PRESS:
-      bevent = (GdkEventButton *) event;
+      /*bevent = (GdkEventButton *) event;*/
 
       if((!pw->scene_detection_busy)
       && (!sgpp->gva_lock)
@@ -1392,12 +1392,12 @@ p_pw_preview_events_cb (GtkWidget *widget
       break;
 
     case GDK_EXPOSE:
-      if(gap_debug) printf("p_pw_preview_events_cb GDK_EXPOSE widget:%d  da_wgt:%d\n"
-                              , (int)widget
-                              , (int)pw->pv_ptr->da_widget
+      if(gap_debug) printf("p_pw_preview_events_cb GDK_EXPOSE widget:%ld  da_wgt:%ld\n"
+                              , (long)widget
+                              , (long)pw->pv_ptr->da_widget
                               );
 
-      eevent = (GdkEventExpose *) event;
+      /*eevent = (GdkEventExpose *) event;*/
 
       if(widget == pw->pv_ptr->da_widget)
       {
@@ -1424,8 +1424,8 @@ p_pw_mask_preview_events_cb (GtkWidget *widget
                        , GdkEvent  *event
                        , GapStbPropWidget *pw)
 {
-  GdkEventExpose *eevent;
-  GdkEventButton *bevent;
+  /*GdkEventExpose *eevent;*/
+  /*GdkEventButton *bevent;*/
   GapStbMainGlobalParams  *sgpp;
 
   if ((pw->stb_elem_refptr == NULL)
@@ -1439,7 +1439,7 @@ p_pw_mask_preview_events_cb (GtkWidget *widget
   switch (event->type)
   {
     case GDK_BUTTON_PRESS:
-      bevent = (GdkEventButton *) event;
+      /*bevent = (GdkEventButton *) event;*/
 
       if((!pw->scene_detection_busy)
       && (!sgpp->gva_lock)
@@ -1451,12 +1451,14 @@ p_pw_mask_preview_events_cb (GtkWidget *widget
       break;
 
     case GDK_EXPOSE:
-      if(gap_debug) printf("p_pw_mask_preview_events_cb GDK_EXPOSE widget:%d  da_wgt:%d\n"
-                              , (int)widget
-                              , (int)pw->mask_pv_ptr->da_widget
+      if(gap_debug)
+      {
+        printf("p_pw_mask_preview_events_cb GDK_EXPOSE widget:%ld  da_wgt:%ld\n"
+                              , (long)widget
+                              , (long)pw->mask_pv_ptr->da_widget
                               );
-
-      eevent = (GdkEventExpose *) event;
+      }
+      /*eevent = (GdkEventExpose *) event;*/
 
       if(widget == pw->mask_pv_ptr->da_widget)
       {
@@ -1559,8 +1561,8 @@ p_pw_icontype_preview_events_cb (GtkWidget *widget
                        , GdkEvent  *event
                        , GapStbPropWidget *pw)
 {
-  GdkEventExpose *eevent;
-  GdkEventButton *bevent;
+  /*GdkEventExpose *eevent;*/
+  /*GdkEventButton *bevent;*/
   GapStbMainGlobalParams  *sgpp;
 
   if ((pw->stb_elem_refptr == NULL)
@@ -1574,7 +1576,7 @@ p_pw_icontype_preview_events_cb (GtkWidget *widget
   switch (event->type)
   {
     case GDK_BUTTON_PRESS:
-      bevent = (GdkEventButton *) event;
+      /*bevent = (GdkEventButton *) event;*/
 
       if((!pw->scene_detection_busy)
       && (!sgpp->gva_lock)
@@ -1596,12 +1598,12 @@ p_pw_icontype_preview_events_cb (GtkWidget *widget
     case GDK_EXPOSE:
       if(gap_debug)
       {
-        printf("p_pw_icontype_preview_events_cb GDK_EXPOSE widget:%d  da_wgt:%d\n"
-                              , (int)widget
-                              , (int)pw->typ_icon_pv_ptr->da_widget
+        printf("p_pw_icontype_preview_events_cb GDK_EXPOSE widget:%ld  da_wgt:%ld\n"
+                              , (long)widget
+                              , (long)pw->typ_icon_pv_ptr->da_widget
                               );
       }
-      eevent = (GdkEventExpose *) event;
+      /*eevent = (GdkEventExpose *) event;*/
 
       if(widget == pw->typ_icon_pv_ptr->da_widget)
       {
@@ -2042,7 +2044,7 @@ p_pw_set_mask_name_dependent_widget_sensitivity(GapStbPropWidget *pw, gint activ
   l_sensitive = TRUE;
   if(active_index <= 0)
   {
-    /* active index 0 always refers to NONE (e.g clip has no mask) */
+    /* active index 0 always refers to NONE (i.e. clip has no mask) */
     l_sensitive = FALSE;
   }
   l_show = l_sensitive;
@@ -2841,7 +2843,7 @@ p_pw_update_framenr_labels(GapStbPropWidget *pw, gint32 framenr)
   l_framenr_zero = framenr -1;
   if(pw->stb_elem_refptr->record_type == GAP_STBREC_VID_ANIMIMAGE)
   {
-    /* animimage framenr (e.g. layerstack position) starts at 0
+    /* animimage framenr (i.e. layerstack position) starts at 0
      * (other clips typically start with framenr 1)
      */
     l_framenr_zero = framenr;
@@ -3411,7 +3413,7 @@ on_clip_elements_dropped_as_mask_ref (GtkWidget        *widget,
         fw_drop = *fw_drop_ptr;
         if(gap_debug)
         {
-          printf("on_clip_elements_dropped_as_mask_ref FW_DROP:%d\n", (int)fw_drop);
+          printf("on_clip_elements_dropped_as_mask_ref FW_DROP:%ld\n", (long)fw_drop);
         }
         if (fw_drop == NULL)
         {
@@ -4022,7 +4024,7 @@ gap_story_pw_properties_dialog (GapStbPropWidget *pw)
 
   if(gap_debug)
   {
-    printf("gap_story_pw_properties_dialog before g_signal_connect dlg:%d\n", (int)dlg);
+    printf("gap_story_pw_properties_dialog before g_signal_connect dlg:%ld\n", (long)dlg);
   }
 
   g_signal_connect (G_OBJECT (dlg), "response",
@@ -5102,7 +5104,7 @@ gap_story_pw_properties_dialog (GapStbPropWidget *pw)
 
   if(gap_debug)
   {
-    printf("gap_story_pw_properties_dialog DONE return dlg:%d\n", (int)dlg);
+    printf("gap_story_pw_properties_dialog DONE return dlg:%ld\n", (long)dlg);
   }
 
   return(dlg);
@@ -5224,8 +5226,8 @@ gap_story_stb_elem_properties_dialog ( GapStbTabWidgets *tabw
   pw->pw_prop_dialog = gap_story_pw_properties_dialog(pw);
   if(gap_debug)
   {
-    printf("gap_story_stb_elem_properties_dialog pw->pw_prop_dialog:%d\n"
-          ,(int)pw->pw_prop_dialog
+    printf("gap_story_stb_elem_properties_dialog pw->pw_prop_dialog:%ld\n"
+          ,(long)pw->pw_prop_dialog
           );
   }
   if(pw->pw_prop_dialog)
@@ -5265,4 +5267,3 @@ gap_story_fw_properties_dialog (GapStbFrameWidget *fw)
     gap_story_stb_elem_properties_dialog(tabw, fw->stb_elem_refptr, fw->stb_refptr);
   }
 }  /* end gap_story_fw_properties_dialog */
-
diff --git a/gap/gap_story_render_lossless.c b/gap/gap_story_render_lossless.c
index b9371c5..5ce65d3 100644
--- a/gap/gap_story_render_lossless.c
+++ b/gap/gap_story_render_lossless.c
@@ -119,7 +119,7 @@ p_check_vcodec_name(gint32 check_flags
       {
         if(codec_elem->codec_name)
         {
-          if(strcmp(codec_elem->codec_name, vcodec_name_chunk) == 0)
+          if(strcmp((const char*)codec_elem->codec_name, (const char *)vcodec_name_chunk) == 0)
           {
             return (TRUE);
           }
@@ -578,7 +578,6 @@ p_story_attempt_fetch_chunk(GapStoryRenderVidHandle *vidhand
 #define GAP_MPEG_ASSUMED_REFERENCE_DISTANCE 3
   static gint32     last_video_frame_nr = -1;
 
-  gchar  *l_framename;
   gchar  *l_videofile;
   GapStoryRenderFrameRangeElem *l_frn_elem;
   GapStoryRenderFrameRangeElem *l_frn_elem_2;
@@ -593,7 +592,6 @@ p_story_attempt_fetch_chunk(GapStoryRenderVidHandle *vidhand
 
 
   l_videofile = NULL;     /* NULL: also used as flag for "MUST fetch regular uncompressed frame" */
-  l_framename = NULL;
   l_video_frame_nr = 1;
 
 
@@ -696,9 +694,9 @@ p_story_attempt_fetch_chunk(GapStoryRenderVidHandle *vidhand
 
         if(gap_debug)
         {
-          printf("p_story_attempt_fetch_chunk:  AFTER CHUNK fetch max:%d chunk_data:%d  chunk_size:%d\n"
+          printf("p_story_attempt_fetch_chunk:  AFTER CHUNK fetch max:%d chunk_data:%ld  chunk_size:%d\n"
                       ,(int)video_frame_chunk_maxsize
-                      ,(int)video_frame_chunk_data
+                      ,(long)video_frame_chunk_data
                       ,(int)*video_frame_chunk_size
                       );
         }
@@ -1077,15 +1075,12 @@ gap_story_render_fetch_composite_image_or_chunk(GapStoryRenderVidHandle *vidhand
   static gboolean   last_fetch_was_compressed_chunk = FALSE;
 
   gchar  *l_videofile;
-  GapStoryRenderFrameRangeElem *l_frn_elem;
-
   gboolean      l_enable_chunk_fetch;
 
 
   *image_id         = -1;
   *layer_id         = -1;
   *force_keyframe   = FALSE;
-  l_frn_elem        = NULL;
   *video_frame_chunk_size = 0;
   *video_frame_chunk_hdr_size = 0;  /* assume chunk contains no frame header */
   l_enable_chunk_fetch = dont_recode_flag;
@@ -1294,8 +1289,6 @@ gap_story_render_fetch_composite_image_or_buffer_or_chunk(GapStoryRenderVidHandl
   static gboolean   last_fetch_was_compressed_chunk = FALSE;
 
   gchar  *l_videofile;
-  GapStoryRenderFrameRangeElem *l_frn_elem;
-
   gboolean      l_enable_chunk_fetch;
 
   /* init result record */
@@ -1306,7 +1299,6 @@ gap_story_render_fetch_composite_image_or_buffer_or_chunk(GapStoryRenderVidHandl
   gapStoryFetchResult->video_frame_chunk_size     = 0;
   gapStoryFetchResult->video_frame_chunk_hdr_size = 0;     /* assume chunk contains no frame header */
   
-  l_frn_elem        = NULL;
   l_enable_chunk_fetch = dont_recode_flag;
   
   if ((gapStoryFetchResult->video_frame_chunk_data == NULL)
@@ -1355,7 +1347,7 @@ gap_story_render_fetch_composite_image_or_buffer_or_chunk(GapStoryRenderVidHandl
                          , vid_width
                          , vid_height
                          , vcodec_list
-                         , &gapStoryFetchResult->video_frame_chunk_data
+                         , gapStoryFetchResult->video_frame_chunk_data
                          , &gapStoryFetchResult->video_frame_chunk_size
                          , video_frame_chunk_maxsize
                          , master_framerate
@@ -1429,4 +1421,3 @@ gap_story_render_fetch_composite_image_or_buffer_or_chunk(GapStoryRenderVidHandl
 
 
 } /* end gap_story_render_fetch_composite_image_or_buffer_or_chunk */
-
diff --git a/gap/gap_story_render_processor.c b/gap/gap_story_render_processor.c
index ba8553f..2b89299 100644
--- a/gap/gap_story_render_processor.c
+++ b/gap/gap_story_render_processor.c
@@ -220,15 +220,6 @@ static void     p_init_stb_error(GapStoryRenderErrors *sterr);
 static void     p_free_stb_error(GapStoryRenderErrors *sterr);
 static void     p_set_stb_error(GapStoryRenderErrors *sterr, char *errtext);
 static void     p_refresh_min_max_vid_tracknumbers(GapStoryRenderVidHandle *vidhand);
-
-static gdouble  p_attribute__at_step(gint32 frame_step /* current frame (since start of current processed 
clip */
-                 ,gdouble from_val
-                 ,gdouble to_val
-                 ,gint32  frames_dur        /* duration of the complete transition in frames */
-                 ,gint32  frames_done       /* already handled steps in previous clips */
-                 ,gint    accel             /* acceleration characteristic for the transition */
-                 );
-
 static void     p_select_section_by_name(GapStoryRenderVidHandle *vidhand
                   , const char *section_name);
 
@@ -575,7 +566,6 @@ static gint32    p_story_render_fetch_composite_image_private(GapStoryRenderVidH
 static GMutex *
 p_pooled_g_mutex_new()
 {
-  GMutex       *mutex;
   StbMutexPool *mutexp;
 
   for(mutexp = mutexPool; mutexp != NULL; mutexp=mutexp->next)
@@ -585,8 +575,8 @@ p_pooled_g_mutex_new()
       mutexp->isFree = FALSE;
       if(gap_debug)
       {
-        printf("p_pooled_g_mutex_new: recycle mutex:%d\n"
-          ,(int)mutexp->mutex
+        printf("p_pooled_g_mutex_new: recycle mutex:%ld\n"
+          ,(long)mutexp->mutex
           );
       }
       return(mutexp->mutex);
@@ -601,8 +591,8 @@ p_pooled_g_mutex_new()
 
   if(gap_debug)
   {
-    printf("p_pooled_g_mutex_new: allocated new mutex:%d\n"
-       ,(int)mutexp->mutex
+    printf("p_pooled_g_mutex_new: allocated new mutex:%ld\n"
+       ,(long)mutexp->mutex
        );
   }
 
@@ -626,16 +616,16 @@ p_pooled_g_mutex_free(GMutex       *mutex)
       mutexp->isFree = TRUE;
       if(gap_debug)
       {
-        printf("p_pooled_g_mutex_free: disposed mutex:%d for later reuse\n"
-           ,(int)mutexp->mutex
+        printf("p_pooled_g_mutex_free: disposed mutex:%ld for later reuse\n"
+           ,(long)mutexp->mutex
            );
       }
       return;
     }
   }
 
-  printf("p_pooled_g_mutex_free: ** ERROR mutex:%d not found in pool\n"
-           ,(int)mutex
+  printf("p_pooled_g_mutex_free: ** ERROR mutex:%ld not found in pool\n"
+           ,(long)mutex
            );
 
 } /* end p_pooled_g_mutex_free */
@@ -655,7 +645,7 @@ gap_story_render_debug_print_maskdef_elem(GapStoryRenderMaskDefElem *maskdef_ele
 
       printf("  [%d] record_type       : %d\n", (int)l_idx, (int)maskdef_elem->record_type );
       printf("  [%d] mask_name         : ", (int)l_idx); if(maskdef_elem->mask_name) { printf("%s\n", 
maskdef_elem->mask_name );} else { printf ("(null)\n"); }
-      printf("  [%d] mask_vidhand      : %d\n", (int)l_idx, (int)maskdef_elem->mask_vidhand );
+      printf("  [%d] mask_vidhand      : %ld\n", (int)l_idx, (long)maskdef_elem->mask_vidhand );
       printf("  [%d] frame_count       : %d\n", (int)l_idx, (int)maskdef_elem->frame_count );
       printf("  [%d] flip_request      : %d\n", (int)l_idx, (int)maskdef_elem->flip_request );
 
@@ -718,7 +708,7 @@ gap_story_render_debug_print_frame_elem(GapStoryRenderFrameRangeElem *frn_elem,
       printf("  [%d] track (file)      : %d\n", (int)l_idx, (int)(1+(frn_elem->track / 2)) );
       printf("  [%d] basename          : ", (int)l_idx); if(frn_elem->basename) { printf("%s\n", 
frn_elem->basename );} else { printf ("(null)\n"); }
       printf("  [%d] ext               : ", (int)l_idx); if(frn_elem->ext) { printf("%s\n", frn_elem->ext 
);} else { printf ("(null)\n"); }
-      printf("  [%d] gvahand           : %d\n", (int)l_idx, (int)frn_elem->gvahand );
+      printf("  [%d] gvahand           : %ld\n", (int)l_idx, (long)frn_elem->gvahand );
       printf("  [%d] seltrack          : %d\n", (int)l_idx, (int)frn_elem->seltrack );
       printf("  [%d] exact_seek        : %d\n", (int)l_idx, (int)frn_elem->exact_seek );
       printf("  [%d] delace            : %.2f\n", (int)l_idx, (float)frn_elem->delace );
@@ -826,14 +816,14 @@ p_debug_print_render_section_names(GapStoryRenderVidHandle *vidhand)
   printf("\nDEBUG p_debug_print_render_section_names START\n");
   for(section = vidhand->section_list; section != NULL; section = section->next)
   {
-      printf("DEBUG render_section: adr vidhand:%d section:%d section->frn_list:%d)"
-           , (int)vidhand
-           , (int)section
-           , (int)section->frn_list
+      printf("DEBUG render_section: adr vidhand:%ld section:%ld section->frn_list:%ld)"
+           , (long)vidhand
+           , (long)section
+           , (long)section->frn_list
            );
       if (section->section_name == NULL)
       {
-        printf("section_name: (null) e.g. MAIN\n");
+        printf("section_name: (null) is the MAIN section\n");
       }
       else
       {
@@ -902,7 +892,7 @@ gap_story_render_debug_print_audiorange_list(GapStoryRenderAudioRangeElem *aud_l
       printf("  [%d] track             : %d\n", (int)l_idx, (int)aud_elem->track );
       printf("  [%d] audiofile         : ", (int)l_idx); if(aud_elem->audiofile) { printf("%s\n", 
aud_elem->audiofile );} else { printf ("(null)\n"); }
       printf("  [%d] tmp_audiofile     : ", (int)l_idx); if(aud_elem->tmp_audiofile) { printf("%s\n", 
aud_elem->tmp_audiofile );} else { printf ("(null)\n"); }
-      printf("  [%d] gvahand           : %d\n", (int)l_idx, (int)aud_elem->gvahand );
+      printf("  [%d] gvahand           : %ld\n", (int)l_idx, (long)aud_elem->gvahand );
       printf("  [%d] seltrack          : %d\n", (int)l_idx, (int)aud_elem->seltrack );
 
       printf("  [%d] samplerate        : %d\n", (int)l_idx, (int)aud_elem->samplerate );
@@ -912,7 +902,7 @@ gap_story_render_debug_print_audiorange_list(GapStoryRenderAudioRangeElem *aud_l
 
 
       printf("  [%d] audio_id          : %d\n", (int)l_idx, (int)aud_elem->audio_id);
-      printf("  [%d] aud_data          : %d\n", (int)l_idx, (int)aud_elem->aud_data);
+      printf("  [%d] aud_data          : %ld\n", (int)l_idx, (long)aud_elem->aud_data);
       printf("  [%d] aud_bytelength    : %d\n", (int)l_idx, (int)aud_elem->aud_bytelength);
 
       printf("  [%d] range_samples     : %d\n", (int)l_idx, (int)aud_elem->range_samples );
@@ -1181,7 +1171,7 @@ gap_story_render_set_stb_warning(GapStoryRenderErrors *sterr, char *warntext)
  * findout the lowest and highest track number used
  * in the current framerange list in the specified storyboard videohandle.
  *
- * (and constraint the values to limits e.g. array boundaries)
+ * (and constraint the values to limits such as array boundaries)
  *
  * This procedure is typicall called each time the frn_list
  * of a storyboard videohandle (GapStoryRenderVidHandle *vidhand)
@@ -1347,9 +1337,9 @@ p_select_section_by_name(GapStoryRenderVidHandle *vidhand, const char *section_n
 
   if(gap_debug)
   {
-    printf("p_select_section_by_name: addr of section: %d Resulting addr of frn_list: %d)\n"
-       , (int)section
-       , (int)vidhand->frn_list
+    printf("p_select_section_by_name: addr of section: %ld Resulting addr of frn_list: %ld)\n"
+       , (long)section
+       , (long)vidhand->frn_list
        );
     fflush(stdout);
   }
@@ -2766,7 +2756,7 @@ p_storyboard_analyze(GapStoryBoard *stb
   {
     if (stb_section == stb->mask_section)
     {
-        /* ignore mask definitions (e.g. all elements in mask_section) here,
+        /* ignore mask definitions (this are all elements in mask_section) here,
          * because mask definitions are handled separately.
          * (for the rendering mask_definitions are not handled like sub sections,
          * mask_definitions have global scope in the whole storyboard
@@ -2820,7 +2810,7 @@ p_storyboard_analyze(GapStoryBoard *stb
        * that are generated only for internal usage if a videotrack uses overlapping
        * frames.
        * the lowest internal tracknumber always appears in foreground
-       * (e.g. is placed on top of layerstack at rendering of the composite frame)
+       * (it is placed on top of layerstack at rendering of the composite frame)
        */
       if (stb->master_vtrack1_is_toplayer)
       {
@@ -3355,9 +3345,9 @@ p_framerange_list_from_storyboard(const char *storyboard_file
 
   if(gap_debug)
   {
-    printf("p_framerange_list_from_storyboard: START vidhand:%d stb_mem_ptr;%d"
-      , (int)vidhand
-      , (int)stb_mem_ptr
+    printf("p_framerange_list_from_storyboard: START vidhand:%ld stb_mem_ptr;%ld"
+      , (long)vidhand
+      , (long)stb_mem_ptr
       );
     if (storyboard_file == NULL)
     {
@@ -3445,8 +3435,8 @@ p_framerange_list_from_storyboard(const char *storyboard_file
 
   if(gap_debug)
   {
-    printf("p_framerange_list_from_storyboard: END vidhand:%d\n"
-      , (int)vidhand
+    printf("p_framerange_list_from_storyboard: END vidhand:%ld\n"
+      , (long)vidhand
       );
   }
 
@@ -3743,7 +3733,7 @@ gap_story_render_close_vid_handle(GapStoryRenderVidHandle *vidhand)
    p_free_stb_error(vidhand->sterr);
    p_free_mask_definitions(vidhand);
 
-   /* unregister frame fetcher resource usage (e.g. the image cache) */
+   /* unregister frame fetcher resource usage (i.e. the image cache) */
    gap_frame_fetch_unregister_user(vidhand->ffetch_user_id);
    vidhand->section_list = NULL;
    vidhand->frn_list = NULL;
@@ -4104,7 +4094,7 @@ p_open_video_handle_private(    gboolean ignore_audio
 
   if(gap_debug)
   {
-    printf("p_open_video_handle_private: new vidhand:%d\n", (int)vidhand);
+    printf("p_open_video_handle_private: new vidhand:%ld\n", (long)vidhand);
   }
 
   if(progress_ptr) { vidhand->progress = progress_ptr; }
@@ -4121,7 +4111,7 @@ p_open_video_handle_private(    gboolean ignore_audio
     vidhand->status_msg_len = 0;
   }
 
-  /* registrate as user of the frame fetcher resources (e.g. the image cache) */
+  /* registrate as user of the frame fetcher resources (i.e. the image cache) */
   vidhand->ffetch_user_id = 
gap_frame_fetch_register_user("gap_story_render_processor.p_open_video_handle_private");
 
   vidhand->isLogResourceUsage = FALSE;
@@ -4201,8 +4191,8 @@ p_open_video_handle_private(    gboolean ignore_audio
 
   if(gap_debug)
   {
-    printf("p_open_video_handle_private: OPENING vidhand:%d\n"
-      , (int)vidhand
+    printf("p_open_video_handle_private: OPENING vidhand:%ld\n"
+      , (long)vidhand
       );
     p_debug_print_render_section_names(vidhand);
   }
@@ -4484,7 +4474,7 @@ p_open_video_handle_private(    gboolean ignore_audio
 
   if(gap_debug)
   {
-    printf("\n\np_open_video_handle_private: END vidhand:%d\n\n", (int)vidhand);
+    printf("\n\np_open_video_handle_private: END vidhand:%ld\n\n", (long)vidhand);
     gap_story_render_debug_print_framerange_list(vidhand->frn_list, -1);
   }
   return(vidhand);
@@ -5017,11 +5007,6 @@ p_transform_with_movepath_processing( gint32 comp_image_id
   gint   result_width;
   gint   result_height;
 
-  GapStoryCalcAttr  calculate_attributes;
-  GapStoryCalcAttr  *calculated;
-
-
-
   if(gap_debug)
   {
     printf("\n--\np_transform_with_movepath_processing: called at layer_id: %d, tmp_image_id:%d 
comp_image_id:%d\n"
@@ -5044,7 +5029,7 @@ p_transform_with_movepath_processing( gint32 comp_image_id
   if(frn_elem != NULL)
   {
     /* process mask before the movepath transitions
-     * (but only in case when not achored to master, e.g anchored to clip)
+     * (but only in case when not achored to master, but is anchored to clip)
      */
     if((frn_elem->mask_name != NULL)
     && (frn_elem->mask_anchor != GAP_MSK_ANCHOR_MASTER))
@@ -5103,7 +5088,7 @@ p_transform_with_movepath_processing( gint32 comp_image_id
    * further processing continues with the result of movepath processing
    * (the image l_tmp_movpath_image_id)
    * note that the resulting layer (l_movepath_layer_id) may be oversized,
-   * e.g may overlap image boudaries due to the movepath transformations
+   * i.e. may overlap image boudaries due to the movepath transformations
    * (when the clip to image flag was not active in movepath processing)
    */
   if(gap_debug)
@@ -5345,7 +5330,6 @@ p_transform_and_add_layer( gint32 comp_image_id
   gint32 l_new_layer_id;
   gint32 l_fsel_layer_id;
   gint32 l_fmac_layer_id;
-  gint32 l_movepath_layer_id;
   gint32 l_tmp_image_id;
   gint32 l_layermode;
 
@@ -5932,9 +5916,6 @@ p_calculateGvahandHolderRank(GapStoryRenderFrameRangeElem *frn_elem
 {
   t_GVA_Handle      *gvahand;
   t_GVA_RetCode      l_fcr;
-  gint32             rank;
-
-  rank = GVAHAND_HOLDER_RANK_MIN_LEVEL;
 
   gvahand = frn_elem->gvahand;
   l_fcr = GVA_search_fcache(gvahand, videoFrameNrToBeReadNext);
@@ -6049,7 +6030,7 @@ p_try_to_steal_gvahand(GapStoryRenderVidHandle *vidhand
   }
 
   /* check for open videos in case there are mask definitions
-   * this is not done in case we are already rendering a mask (e.g vidhand is the mask handle)
+   * this is not done in case we are already rendering a mask (where vidhand is the mask handle)
    * In case the rank is above the GVAHAND_HOLDER_RANK_NO_BENEFIT_LEVEL
    * we can skip this check, because an already opened handled will be reused.
    */
@@ -6083,9 +6064,9 @@ p_try_to_steal_gvahand(GapStoryRenderVidHandle *vidhand
       t_GVA_Handle *gvahand;
       if(gap_debug)
       {
-        printf("(RE)using GVA handle for %s gvahand:%d Rank:%d holder(track:%d from:%d to:%d) 
requestor(track:%d from:%d to:%d) open videofile: %d (max:%d)\n"
+        printf("(RE)using GVA handle for %s gvahand:%ld Rank:%d holder(track:%d from:%d to:%d) 
requestor(track:%d from:%d to:%d) open videofile: %d (max:%d)\n"
               , frn_elem_gvahandHolder->basename
-              , (int)gvahand
+              , (long)gvahand
               , (int)gvahandHolderRank
               , (int)frn_elem_gvahandHolder->track
               , (int)frn_elem_gvahandHolder->frame_from
@@ -7371,16 +7352,16 @@ p_call_GVA_close(t_GVA_Handle *gvahand)
 {
   if(gap_debug)
   {
-    printf("p_call_GVA_close gvahand:%d\n"
-          ,(int)gvahand
+    printf("p_call_GVA_close gvahand:%ld\n"
+          ,(long)gvahand
           );
   }
   if(gvahand)
   {
     if(gap_debug)
     {
-      printf("p_call_GVA_close  gvahand:%d (close is pending for %s)\n"
-           ,(int)gvahand
+      printf("p_call_GVA_close  gvahand:%ld (close is pending for %s)\n"
+           ,(long)gvahand
             ,gvahand->filename
             );
     }
@@ -7404,20 +7385,20 @@ RETRY:
         {
           if(gap_debug)
           {
-            printf("call_GVA_closeWAIT until prefetch worker thread finished (close is pending for %s) 
retry:%d mutex:%d fcache_mutex:%d\n"
+            printf("call_GVA_closeWAIT until prefetch worker thread finished (close is pending for %s) 
retry:%d mutex:%ld fcache_mutex:%ld\n"
                   ,gvahand->filename
                   ,(int)retryCount
-                  ,(int)mutex
-                  ,(int)gvahand->fcache_mutex
+                  ,(long)mutex
+                  ,(long)gvahand->fcache_mutex
                   );
           }
           g_cond_wait (vpre->prefetchDoneCond, vpre->mutex);
 
           if(gap_debug)
           {
-            printf("call_GVA_close WAKE-UP prefetch worker thread finished (closing video %s) mutex:%d\n"
+            printf("call_GVA_close WAKE-UP prefetch worker thread finished (closing video %s) mutex:%ld\n"
                   ,gvahand->filename
-                  ,(int)mutex
+                  ,(long)mutex
                   );
           }
           GVA_fcache_mutex_unlock (vpre->gvahand);
@@ -7432,11 +7413,11 @@ RETRY:
         {
           if(gap_debug)
           {
-            printf("call_GVA_close PrefetchThread NOT RUNNING, (closing video %s) retry:%d mutex:%d 
fcache_mutex:%d\n"
+            printf("call_GVA_close PrefetchThread NOT RUNNING, (closing video %s) retry:%d mutex:%ld 
fcache_mutex:%ld\n"
                   ,gvahand->filename
                   ,retryCount
-                  ,(int)mutex
-                  ,(int)gvahand->fcache_mutex
+                  ,(long)mutex
+                  ,(long)gvahand->fcache_mutex
                   );
           }
         }
@@ -7479,8 +7460,8 @@ p_call_GVA_search_fcache_and_get_frame_as_gimp_layer_or_rgb888(t_GVA_Handle *gva
 {
   if(gap_debug)
   {
-    printf("before call GVA_search_fcache: gvahand:%d framenumber:%d deinterlace:%d numProcessors:%d 
caller:%s\n"
-      ,(int)gvahand
+    printf("before call GVA_search_fcache: gvahand:%ld framenumber:%d deinterlace:%d numProcessors:%d 
caller:%s\n"
+      ,(long)gvahand
       ,(int)framenumber
       ,(int)deinterlace
       ,(int)numProcessors
@@ -7499,11 +7480,11 @@ p_call_GVA_search_fcache_and_get_frame_as_gimp_layer_or_rgb888(t_GVA_Handle *gva
   if(gap_debug)
   {
     printf("after call GVA_search_fcache: "
-      "gvahand:%d framenumber:%d isRgb888Result:%d data:%d image_id:%d layer_id:%d isFrameAvailable:%d\n"
-      ,(int)gvahand
+      "gvahand:%ld framenumber:%d isRgb888Result:%d data:%ld image_id:%d layer_id:%d isFrameAvailable:%d\n"
+      ,(long)gvahand
       ,(int)framenumber
       ,(int)fcacheFetchResult->isRgb888Result
-      ,(int)fcacheFetchResult->rgbBuffer.data
+      ,(long)fcacheFetchResult->rgbBuffer.data
       ,(int)fcacheFetchResult->image_id
       ,(int)fcacheFetchResult->layer_id
       ,(int)fcacheFetchResult->isFrameAvailable
@@ -7578,7 +7559,6 @@ p_stb_render_movie_single_processor(GapStbFetchData *gfd
   {
      gint32 l_deinterlace;
      gdouble l_threshold;
-     t_GVA_RetCode  l_fcr;
 
      /* split delace value: integer part is deinterlace mode, rest is threshold */
      p_split_delace_value(gfd->frn_elem->delace
@@ -7713,9 +7693,9 @@ p_call_GVA_get_next_frame_andSendReadySignal(VideoPrefetchData *vpre, gint32 tar
 {
   if(gap_debug)
   {
-    printf("p_call_GVA_get_next_frame TID:%lld gvahand:%d targetFrameNumber:%d seek_nr:%d\n"
-      , gap_base_get_thread_id()
-      , (int)vpre->gvahand
+    printf("p_call_GVA_get_next_frame TID:%lld gvahand:%ld targetFrameNumber:%d seek_nr:%d\n"
+      , (long long int)gap_base_get_thread_id()
+      , (long)vpre->gvahand
       , (int)targetFrameNumber
       , (int)vpre->gvahand->current_seek_nr
       );
@@ -7727,9 +7707,9 @@ p_call_GVA_get_next_frame_andSendReadySignal(VideoPrefetchData *vpre, gint32 tar
   {
     if(gap_debug)
     {
-      printf("p_call_GVA_get_next_frame TID:%lld gvahand:%d targetFrameNumber:%d SEND targetFrameReadyCond\n"
-        , gap_base_get_thread_id()
-        , (int)vpre->gvahand
+      printf("p_call_GVA_get_next_frame TID:%lld gvahand:%ld targetFrameNumber:%d SEND 
targetFrameReadyCond\n"
+        , (long long int)gap_base_get_thread_id()
+        , (long)vpre->gvahand
         , (int)targetFrameNumber
         );
     }
@@ -7751,7 +7731,7 @@ p_call_GVA_get_next_frame_andSendReadySignal(VideoPrefetchData *vpre, gint32 tar
  *
  * In case there is more than one videotrack to be processed,
  * there may be more than one prefetch worker thread running parallel at the same time
- * where each of those threads has its own VideoPrefetchData (e.g has its own gva video handle)
+ * where each of those threads has its own VideoPrefetchData (and therfore has its own gva video handle)
  *
  * Note: prefetch of backwards read fill up the fcache too, but in this case
  * the target framenumber is the last one to be read from the videofile
@@ -7768,9 +7748,9 @@ p_videoPrefetchWorkerThreadFunction (VideoPrefetchData *vpre)
 
   if(gap_debug)
   {
-    printf("p_videoPrefetchWorkerThreadFunction START (before mutex lock) TID:%lld gvahand:%d  
targetFrameNumber:%d\n"
-         , gap_base_get_thread_id()
-         ,(int)vpre->gvahand
+    printf("p_videoPrefetchWorkerThreadFunction START (before mutex lock) TID:%lld gvahand:%ld  
targetFrameNumber:%d\n"
+         ,(long long int)gap_base_get_thread_id()
+         ,(long)vpre->gvahand
          ,(int)vpre->targetFrameNumber
          );
   }
@@ -7798,9 +7778,9 @@ p_videoPrefetchWorkerThreadFunction (VideoPrefetchData *vpre)
     {
       if(gap_debug)
       {
-        printf("p_videoPrefetchWorkerThreadFunction TID:%lld NEAR FORWARD READ gvahand:%d 
targetFrameNumber:%d\n"
-        , gap_base_get_thread_id()
-         ,(int)vpre->gvahand
+        printf("p_videoPrefetchWorkerThreadFunction TID:%lld NEAR FORWARD READ gvahand:%ld 
targetFrameNumber:%d\n"
+        , (long long int)gap_base_get_thread_id()
+         ,(long)vpre->gvahand
          ,(int)targetFrameNumber
          );
       }
@@ -7828,9 +7808,9 @@ p_videoPrefetchWorkerThreadFunction (VideoPrefetchData *vpre)
 
         if(gap_debug)
         {
-          printf("p_videoPrefetchWorkerThreadFunction TID:%lld gvahand:%d BACKWARD READ 
targetFrameNumber:%d\n"
-             , gap_base_get_thread_id()
-             ,(int)vpre->gvahand
+          printf("p_videoPrefetchWorkerThreadFunction TID:%lld gvahand:%ld BACKWARD READ 
targetFrameNumber:%d\n"
+             , (long long int)gap_base_get_thread_id()
+             ,(long)vpre->gvahand
              ,(int)targetFrameNumber
              );
         }
@@ -7842,9 +7822,9 @@ p_videoPrefetchWorkerThreadFunction (VideoPrefetchData *vpre)
         {
             if(gap_debug)
             {
-              printf("BACKWARD TID:%lld prefetch fcache filling read gvahand:%d current_seek_nr:%d 
target_frame_nr:%d\n"
-                , gap_base_get_thread_id()
-                ,(int)vpre->gvahand
+              printf("BACKWARD TID:%lld prefetch fcache filling read gvahand:%ld current_seek_nr:%d 
target_frame_nr:%d\n"
+                , (long long int)gap_base_get_thread_id()
+                ,(long)vpre->gvahand
                 ,(int)vpre->gvahand->current_seek_nr
                 ,(int)prefetchFrameNumber
                 );
@@ -7856,9 +7836,9 @@ p_videoPrefetchWorkerThreadFunction (VideoPrefetchData *vpre)
       {
         if(gap_debug)
         {
-          printf("p_videoPrefetchWorkerThreadFunction TID:%lld SEEK / READ gvahand:%d targetFrameNumber:%d\n"
-                , gap_base_get_thread_id()
-                ,(int)vpre->gvahand
+          printf("p_videoPrefetchWorkerThreadFunction TID:%lld SEEK / READ gvahand:%ld 
targetFrameNumber:%d\n"
+                , (long long int)gap_base_get_thread_id()
+                ,(long)vpre->gvahand
                 ,(int)targetFrameNumber
                 );
         }
@@ -7880,9 +7860,9 @@ p_videoPrefetchWorkerThreadFunction (VideoPrefetchData *vpre)
 
   if(gap_debug)
   {
-    printf("p_videoPrefetchWorkerThreadFunction DONE TID:%lld gvahand:%d\n"
-       ,gap_base_get_thread_id()
-       ,(int)vpre->gvahand
+    printf("p_videoPrefetchWorkerThreadFunction DONE TID:%lld gvahand:%ld\n"
+       ,(long long int)gap_base_get_thread_id()
+       ,(long)vpre->gvahand
        );
   }
 
@@ -8074,8 +8054,8 @@ p_stb_render_movie_multiprocessor(GapStbFetchData *gfd
 
       if(gap_debug)
       {
-        printf("FCACHE-HIT gvahand:%d framenr:%d predictedFrameNr:%d retryCount:%d\n"
-          , (int)vpre->gvahand
+        printf("FCACHE-HIT gvahand:%ld framenr:%d predictedFrameNr:%d retryCount:%d\n"
+          , (long)vpre->gvahand
           , (int)targetFrameNumber
           , (int)predictedNextFrameNr
           , (int)retryCount
@@ -8104,8 +8084,8 @@ p_stb_render_movie_multiprocessor(GapStbFetchData *gfd
           vpre->targetFrameNumber = fnr;
           if(gap_debug)
           {
-            printf("MORE-PREFETCH PUSH-1 gvahand:%d framenr:%d predictedFrameNr:%d retryCount:%d\n"
-              , (int)vpre->gvahand
+            printf("MORE-PREFETCH PUSH-1 gvahand:%ld framenr:%d predictedFrameNr:%d retryCount:%d\n"
+              , (long)vpre->gvahand
               , (int)fnr
               , (int)predictedNextFrameNr
               , (int)retryCount
@@ -8135,8 +8115,8 @@ p_stb_render_movie_multiprocessor(GapStbFetchData *gfd
 
         if(gap_debug)
         {
-            printf("TRIGGER PREFETCH PUSH-2 gvahand:%d targetFrameNumber:%d predictedFrameNr:%d 
retryCount:%d\n"
-              , (int)vpre->gvahand
+            printf("TRIGGER PREFETCH PUSH-2 gvahand:%ld targetFrameNumber:%d predictedFrameNr:%d 
retryCount:%d\n"
+              , (long)vpre->gvahand
               , (int)targetFrameNumber
               , (int)predictedNextFrameNr
               , (int)retryCount
@@ -8154,8 +8134,8 @@ p_stb_render_movie_multiprocessor(GapStbFetchData *gfd
 
       if(gap_debug)
       {
-        printf("WAIT  gvahand:%d until prefetch worker thread has fetched target framenr:%d 
predictedFrameNr:%d retryCount:%d\n"
-          , (int)vpre->gvahand
+        printf("WAIT  gvahand:%ld until prefetch worker thread has fetched target framenr:%d 
predictedFrameNr:%d retryCount:%d\n"
+          , (long)vpre->gvahand
           , (int)targetFrameNumber
           , (int)predictedNextFrameNr
           , (int)retryCount
@@ -8175,8 +8155,8 @@ p_stb_render_movie_multiprocessor(GapStbFetchData *gfd
 
       if(gap_debug)
       {
-        printf("WAKE-UP gvahand:%d target framenr:%d predictedFrameNr:%d retryCount:%d\n"
-          , (int)vpre->gvahand
+        printf("WAKE-UP gvahand:%ld target framenr:%d predictedFrameNr:%d retryCount:%d\n"
+          , (long)vpre->gvahand
           , (int)targetFrameNumber
           , (int)predictedNextFrameNr
           , (int)retryCount
@@ -8190,8 +8170,8 @@ p_stb_render_movie_multiprocessor(GapStbFetchData *gfd
 
   if(gap_debug)
   {
-    printf("RETRY LOOP gvahand:%d done target framenr:%d predictedFrameNr:%d layerId:%d isRgb888Result:%d 
retryCount:%d\n"
-      , (int)vpre->gvahand
+    printf("RETRY LOOP gvahand:%ld done target framenr:%d predictedFrameNr:%d layerId:%d isRgb888Result:%d 
retryCount:%d\n"
+      , (long)vpre->gvahand
       , (int)targetFrameNumber
       , (int)predictedNextFrameNr
       , (int)fcacheFetchResult.layer_id
@@ -8210,9 +8190,9 @@ p_stb_render_movie_multiprocessor(GapStbFetchData *gfd
     {
       gfd->gapStoryFetchResult->resultEnum = GAP_STORY_FETCH_RESULT_IS_ERROR;
     }
-    printf("** ERROR Failed to fetch from video:%s gvahand:%d frame:%d predictedFrameNr:%d retryCount:%d\n"
+    printf("** ERROR Failed to fetch from video:%s gvahand:%ld frame:%d predictedFrameNr:%d retryCount:%d\n"
           , gfd->frn_elem->gvahand->filename
-          , (int)gfd->frn_elem->gvahand
+          , (long)gfd->frn_elem->gvahand
           , (int)gfd->localframe_index
           , (int)predictedNextFrameNr
           , (int)retryCount
@@ -8684,9 +8664,7 @@ p_paste_logo_pattern(gint32 drawable_id
   gint32        l_fsel_layer_id;
   gint          l_src_offset_x;
   gint          l_src_offset_y;
-  gint32        image_id;
 
-  image_id = gimp_item_get_image(drawable_id);
   gimp_selection_all(gimp_item_get_image(logo_pattern_id));
 
   /* findout the offsets of the replacement_pattern layer within the source Image */
@@ -9128,7 +9106,8 @@ p_story_render_bypass_where_possible(GapStoryRenderVidHandle *vidhand
   /* check clip rerferences in all tracks.
    * (bypass is possible in case the track on top the layerstack refers to a fully opaque movie clip
    * at full image same size without any transitions.
-   * the loop starts at minVidTrack (typically 0) that refers to top of the layerstack position (e.g. 
foreground)
+   * the loop starts at minVidTrack (typically 0) that refers to top of the layerstack position 
+   * (i.e. foreground)
    */
   for(l_track = vidhand->minVidTrack; l_track <= vidhand->maxVidTrack; l_track++)
   {
@@ -9141,14 +9120,14 @@ p_story_render_bypass_where_possible(GapStoryRenderVidHandle *vidhand
     if(gap_debug)
     {
       printf("BYPASSCHECK: track:%d master_frame_nr:%d framename:%s "
-             " trak_filtermacroAdr:%d maskNameAdr:%d insert_alpha:%d insert_area:%d\n"
+             " trak_filtermacroAdr:%ld maskNameAdr:%ld insert_alpha:%ld insert_area:%ld\n"
         ,(int)l_track
         ,(int)master_frame_nr
         ,gfd->framename
-        ,(int)gfd->trak_filtermacro_file
-        ,(int)gfd->frn_elem->mask_name
-        ,(int)vidhand->master_insert_alpha_format
-        ,(int)vidhand->master_insert_area_format
+        ,(long)gfd->trak_filtermacro_file
+        ,(long)gfd->frn_elem->mask_name
+        ,(long)vidhand->master_insert_alpha_format
+        ,(long)vidhand->master_insert_area_format
         );
     }
 
@@ -9229,7 +9208,7 @@ p_story_render_bypass_where_possible(GapStoryRenderVidHandle *vidhand
     }
 
     /* at this point we detected that current layer is fully transparent
-     * therefore we can continue checking the next track (e.g. lower layerstack position)
+     * therefore we can continue checking the next track (i.e. lower layerstack position)
      */
 
   }       /* end for loop over all video tracks */
@@ -9264,7 +9243,7 @@ p_story_render_bypass_where_possible(GapStoryRenderVidHandle *vidhand
        if((gfdMovie->frn_elem->gvahand->width == vid_width)
        && (gfdMovie->frn_elem->gvahand->height == vid_height))
        {
-         /* because there are no transformations and the movie clip is the only active track (e.g. layer)
+         /* because there are no transformations and the movie clip is the only active track (i.e. layer)
           * we can bypass the render processing and deliver the frame data as rgb888 buffer
           */
          gfdMovie->gapStoryFetchResult = gapStoryFetchResult;
@@ -9354,15 +9333,15 @@ p_story_render_fetch_composite_image_private(GapStoryRenderVidHandle *vidhand
 
   if(gap_debug)
   {
-    printf("p_story_render_fetch_composite_image_private START  master_frame_nr:%d  %dx%d vidhand:%d"
-           " enable_rgb888_flag:%d gapStoryFetchResultAdr:%d filtermacroAdr:%d\n"
+    printf("p_story_render_fetch_composite_image_private START  master_frame_nr:%d  %dx%d vidhand:%ld"
+           " enable_rgb888_flag:%d gapStoryFetchResultAdr:%ld filtermacroAdr:%ld\n"
         , (int)master_frame_nr
         , (int)vid_width
         , (int)vid_height
-        , (int)vidhand
+        , (long)vidhand
         , (int)enable_rgb888_flag
-        , (int)gapStoryFetchResult
-        , (int)filtermacro_file
+        , (long)gapStoryFetchResult
+        , (long)filtermacro_file
         );
     if (section_name == NULL)
     {
@@ -9421,7 +9400,7 @@ p_story_render_fetch_composite_image_private(GapStoryRenderVidHandle *vidhand
   }
 
   /* reverse order, has the effect, that track 0 is processed as last track
-   * and will be put on top of the layerstack (e.g. in the foreground)
+   * and will be put on top of the layerstack (i.e. in the foreground)
    */
   for(l_track = vidhand->maxVidTrack; l_track >= vidhand->minVidTrack; l_track--)
   {
diff --git a/gap/gap_story_render_processor.h b/gap/gap_story_render_processor.h
index 4fce598..c49238d 100644
--- a/gap/gap_story_render_processor.h
+++ b/gap/gap_story_render_processor.h
@@ -84,7 +84,7 @@ typedef gpointer t_GVA_Handle;
 /* codec name list element
  */
 typedef struct GapCodecNameElem {
-  guchar *codec_name;
+  gchar *codec_name;
   gint32 video_id;
   
   void  *next;
diff --git a/gap/gap_story_section_properties.c b/gap/gap_story_section_properties.c
index 47d88bb..821bc2f 100644
--- a/gap/gap_story_section_properties.c
+++ b/gap/gap_story_section_properties.c
@@ -117,10 +117,10 @@ p_spw_prop_response(GtkWidget *widget
                   )
 {
   GtkWidget *dlg;
-  GapStbMainGlobalParams  *sgpp;
+  /* GapStbMainGlobalParams  *sgpp; */
   gboolean ok_flag;
 
-  sgpp = spw->sgpp;
+  /* sgpp = spw->sgpp; */
   switch (response_id)
   {
     case GAP_STORY_SECTION_RESPONSE_CREATE:
@@ -217,7 +217,7 @@ p_section_name_entry_set_text(GapStbSecpropWidget *spw, const char *text)
 static gboolean
 p_rename_section(GapStbSecpropWidget *spw)
 {
-  const guchar *section_name;
+  const gchar *section_name;
   if (spw == NULL) { return (TRUE); }
  
   if(spw->section_refptr == NULL)  { return(TRUE); }
@@ -485,15 +485,15 @@ p_spw_icontype_preview_events_cb (GtkWidget *widget
                        , GdkEvent  *event
                        , GapStbSecpropWidget *spw)
 {
-  GdkEventExpose *eevent;
-  GapStbMainGlobalParams  *sgpp;
+  /*GdkEventExpose *eevent;*/
+  /* GapStbMainGlobalParams  *sgpp; */
 
   if ((spw->stb_refptr == NULL))
   {
     /* the widget is not initialized or it is just a dummy, no action needed */
     return FALSE;
   }
-  sgpp = spw->sgpp;
+  /* sgpp = spw->sgpp; */
 
   switch (event->type)
   {
@@ -504,12 +504,12 @@ p_spw_icontype_preview_events_cb (GtkWidget *widget
     case GDK_EXPOSE:
       if(gap_debug)
       {
-        printf("p_spw_icontype_preview_events_cb GDK_EXPOSE widget:%d  da_wgt:%d\n"
-                              , (int)widget
-                              , (int)spw->typ_icon_pv_ptr->da_widget
+        printf("p_spw_icontype_preview_events_cb GDK_EXPOSE widget:%ld  da_wgt:%ld\n"
+                              , (long)widget
+                              , (long)spw->typ_icon_pv_ptr->da_widget
                               );
       }
-      eevent = (GdkEventExpose *) event;
+      /* eevent = (GdkEventExpose *) event; */
 
       if(spw->typ_icon_pv_ptr)
       {
@@ -537,8 +537,7 @@ p_spw_icontype_preview_events_cb (GtkWidget *widget
 static void
 p_spw_section_name_entry_update_cb(GtkWidget *widget, GapStbSecpropWidget *spw)
 {
-  const guchar *section_name;
-  gboolean unique_name_entered;
+  const gchar *section_name;
   GapStorySpwSectionType l_section_type;
   
   
@@ -549,6 +548,15 @@ p_spw_section_name_entry_update_cb(GtkWidget *widget, GapStbSecpropWidget *spw)
   section_name = gtk_entry_get_text(GTK_ENTRY(widget));
 
   l_section_type = p_get_section_type(spw);
+  
+  if(gap_debug)
+  {
+    printf("p_spw_section_name_entry_update_cb section_name:%s l_section_type:%d\n"
+      ,section_name
+      ,(int)l_section_type
+      );
+  }
+  
 //  if(l_section_type == GAP_SPW_TYPE_SUB_SECTION)
 //  {
 //    if(spw->section_refptr->section_name != NULL)
@@ -745,7 +753,6 @@ gap_story_section_spw_properties_dialog (GapStbSecpropWidget *spw)
   GtkWidget *entry;
   gint       row;
   GapStbTabWidgets *tabw;
-  GapStorySpwSectionType l_section_type;
 
   if(spw == NULL) { return (NULL); }
   if(spw->spw_prop_dialog != NULL) { return(NULL); }   /* is already open */
@@ -753,8 +760,6 @@ gap_story_section_spw_properties_dialog (GapStbSecpropWidget *spw)
   tabw = (GapStbTabWidgets *)spw->tabw;
   if(tabw == NULL) { return (NULL); }
 
-  l_section_type = p_get_section_type(spw);
-  
   dlg = gimp_dialog_new (_("Section Properties"), "gap_story_section_properties"
                          ,NULL, 0
                          ,gimp_standard_help_func, GAP_STORY_SECTION_PROP_HELP_ID
@@ -888,7 +893,7 @@ gap_story_section_spw_properties_dialog (GapStbSecpropWidget *spw)
   /* the spw_info_text_label */
   label = gtk_label_new (" *** ");
   spw->spw_info_text_label = label;
-  gtk_label_set_line_wrap(label, TRUE);
+  gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
   gtk_table_attach_defaults (GTK_TABLE(table), label, 1, 2, row, row+1);
   gtk_widget_show (label);
diff --git a/gap/gap_story_sox.c b/gap/gap_story_sox.c
index 1a5caa5..cb0e666 100644
--- a/gap/gap_story_sox.c
+++ b/gap/gap_story_sox.c
@@ -122,7 +122,6 @@ gap_story_sox_exec_resample(char *in_audiofile
   gchar *paramString;
   gchar *l_util_sox;
   gchar *l_util_sox_options;
-  int    l_ret;
   int    l_arg_idx;
   char  *l_ptr;
   char  *l_split_args_string;
@@ -271,7 +270,6 @@ gap_story_sox_exec_resample(char *in_audiofile
   {
     gboolean spawnRc;
     GSpawnFlags spawnFlags = G_SPAWN_STDOUT_TO_DEV_NULL | G_SPAWN_STDERR_TO_DEV_NULL;
-    GError     *spawnError = NULL;
     gint exit_status;
 
     if(!g_file_test (l_util_sox, G_FILE_TEST_IS_EXECUTABLE) )
@@ -311,5 +309,3 @@ gap_story_sox_exec_resample(char *in_audiofile
 
 
 }  /* end gap_story_sox_exec_resample */
-
-
diff --git a/gap/gap_story_undo.c b/gap/gap_story_undo.c
index c513dae..f493d64 100644
--- a/gap/gap_story_undo.c
+++ b/gap/gap_story_undo.c
@@ -67,19 +67,19 @@ gap_stb_undo_debug_fprint_stack(FILE *fp, GapStbTabWidgets *tabw)
     return;
   }
   fprintf(fp, "\n-------------------------------- Top of STACK ---\n\n");
-  fprintf(fp, "gap_stb_undo_debug_fprint_stack: tabw:%d stack_list:%d stack_ptr:%d group_counter:%.2f\n"
-    , (int)tabw
-    , (int)tabw->undo_stack_list
-    , (int)tabw->undo_stack_ptr
+  fprintf(fp, "gap_stb_undo_debug_fprint_stack: tabw:%ld stack_list:%ld stack_ptr:%ld group_counter:%.2f\n"
+    , (long)tabw
+    , (long)tabw->undo_stack_list
+    , (long)tabw->undo_stack_ptr
     , (float)tabw->undo_stack_group_counter
     );
   fflush(fp);
 
   for(undo_elem = tabw->undo_stack_list; undo_elem != NULL; undo_elem = undo_elem->next)
   {
-    fprintf(fp, "  addr:%d fPtr:%d %s"
-          , (int)undo_elem
-          , (int)undo_elem->filenamePtr
+    fprintf(fp, "  addr:%ld fPtr:%ld %s"
+          , (long)undo_elem
+          , (long)undo_elem->filenamePtr
           , gap_stb_undo_feature_to_string(undo_elem->feature_id)
           );
     if(undo_elem == tabw->undo_stack_ptr)
@@ -176,7 +176,7 @@ static GapStoryUndoFileSnapshot*
 p_create_file_snapshot(char *filename)
 {
   GapStoryUndoFileSnapshot *fileSnapshot;
-  const char               *filecontent;
+  char               *filecontent;
 
   fileSnapshot = NULL;
   
@@ -281,7 +281,7 @@ p_replace_file_from_snapshot(GapStoryUndoFileSnapshot* fileSnapshot)
  *                AAAA                               AAAA <--- stack_ptr after pop returns (BBBB)
  * --------------------------------------------------------------------------------
  *
- * if the stack_ptr is on top (e.g. == stack_list root)
+ * if the stack_ptr is on top (i.e. == stack_list root)
  * a duplicate of the current storyboard is pushed as feature_id "latest" onto the stack.
  * this backup reprents the version AFTER feature BBBB of example1 to be re-done
  *
@@ -332,11 +332,11 @@ gap_stb_undo_pop(GapStbTabWidgets *tabw)
   
   if(gap_debug)
   {
-    printf("gap_stb_undo_pop returning feature_id:%d %s grp_count:%.2f next:%d\n"
+    printf("gap_stb_undo_pop returning feature_id:%d %s grp_count:%.2f next:%ld\n"
       ,(int)tabw->undo_stack_ptr->feature_id
       ,gap_stb_undo_feature_to_string(tabw->undo_stack_ptr->feature_id)
       ,(float)tabw->undo_stack_group_counter
-      ,(int)tabw->undo_stack_ptr->next
+      ,(long)tabw->undo_stack_ptr->next
       );
     fflush(stdout);
   }
@@ -353,7 +353,7 @@ gap_stb_undo_pop(GapStbTabWidgets *tabw)
 /* ---------------------------------------
  * gap_stb_undo_redo
  * ---------------------------------------
- * redo the feature that is above (e.g before) the undo stackpointer
+ * redo the feature that is above (i.e. before) the undo stackpointer
  * returns a duplicate of the storyboard backup that is attached to the
  * element 2 above the undo stackpointer.
  * this refers to the backup version at the time BEFORE the
@@ -418,11 +418,11 @@ gap_stb_undo_redo(GapStbTabWidgets *tabw)
 
     if(gap_debug)
     {
-      printf("gap_stb_undo_redo returning feature_id:%d %s grp_count:%.2f resulting stack_ptr:%d\n"
+      printf("gap_stb_undo_redo returning feature_id:%d %s grp_count:%.2f resulting stack_ptr:%ld\n"
         ,(int)redo_elem->feature_id
         ,gap_stb_undo_feature_to_string(redo_elem->feature_id)
         ,(float)tabw->undo_stack_group_counter
-        ,(int)tabw->undo_stack_ptr
+        ,(long)tabw->undo_stack_ptr
         );
       fflush(stdout);
     }
@@ -447,8 +447,8 @@ p_free_undo_elem(GapStoryUndoElem    *undo_elem)
 
   if(gap_debug)
   {
-    printf("p_free_undo_elem: %d %s"
-          , (int)undo_elem
+    printf("p_free_undo_elem: %ld %s"
+          , (long)undo_elem
           , gap_stb_undo_feature_to_string(undo_elem->feature_id)
           );
     if(undo_elem->fileSnapshotBefore != NULL)
@@ -637,7 +637,7 @@ gap_stb_undo_destroy_undo_stack(GapStbTabWidgets *tabw)
  *  EEEE.fileSnapshotBefore holds filename and content of a.xml
  *          (before processing of step EEEE, that is relevant for undo EEEE purpose)
  *  EEEE.fileSnapshotAfter holds filename and content at time of push FFFF 
- *          (e.g. after processing EEEE is finished, that is relevant for redo EEEE purpose)
+ *          (i.e. after processing EEEE is finished, that is relevant for redo EEEE purpose)
  *  EEEE.filenamePtr is rest to NULL
  *
  */
diff --git a/gap/gap_thumbnail.c b/gap/gap_thumbnail.c
index 1336c63..c6045c5 100644
--- a/gap/gap_thumbnail.c
+++ b/gap/gap_thumbnail.c
@@ -251,7 +251,10 @@ p_copy_png_thumb(char *filename_src, char *filename_dst)
               gint  l_width, l_height, l_num_layers;
               gchar *l_type_str;
 
-              if(gap_debug) printf("p_copy_png_thumb: pixbuf: %d\n", (int)pixbuf);
+              if(gap_debug)
+              {
+                printf("p_copy_png_thumb: pixbuf: %ld\n", (long)pixbuf);
+              }
 
               l_width = 1;
               l_height = 1;
@@ -591,7 +594,7 @@ gap_thumb_file_load_pixbuf_thumbnail(char* filename
         printf(" width: %d\n", (int)width );
         printf(" height: %d\n", (int)height );
         printf(" nchannels: %d\n", (int)nchannels );
-        printf(" pix_data: %d\n", (int)pix_data );
+        printf(" pix_data: %ld\n", (long)pix_data );
         printf(" has_alpha: %d\n", (int)has_alpha );
         printf(" rowstride: %d\n", (int)rowstride );
       }
@@ -685,4 +688,3 @@ gap_thumb_file_load_thumbnail(char* filename, gint32 *th_width, gint32 *th_heigh
   return (rc);
 
 }       /* end gap_thumb_file_load_thumbnail */
-
diff --git a/gap/gap_vex_dialog.c b/gap/gap_vex_dialog.c
index 428096e..ef8cd2a 100644
--- a/gap/gap_vex_dialog.c
+++ b/gap/gap_vex_dialog.c
@@ -965,16 +965,24 @@ on_mw__combo_mode_multilayer  (GtkWidget     *widget,
 {
   gint       l_idx;
   gint       value;
-  gboolean   sensitive;
 
-  if(gap_debug) printf("CB: on_mw__combo_mode_multilayer\n");
+  if(gap_debug)
+  {
+    printf("CB: on_mw__combo_mode_multilayer\n");
+  }
 
-  if(gpp == NULL) return;
+  if(gpp == NULL)
+  {
+    return;
+  }
 
   gimp_int_combo_box_get_active (GIMP_INT_COMBO_BOX (widget), &value);
   l_idx = value;
 
-  if(gap_debug) printf("CB: on_mw__combo_mode_multilayer index: %d\n", (int)l_idx);
+  if(gap_debug)
+  {
+    printf("CB: on_mw__combo_mode_multilayer index: %d\n", (int)l_idx);
+  }
 
   gpp->val.multilayer = l_idx;
 
@@ -2022,7 +2030,7 @@ gap_vex_dlg_create_mw__main_window (GapVexMainGlobalParams *gpp)
                          GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                          GTK_STOCK_OK,     GTK_RESPONSE_OK,
                          NULL);
-  gtk_window_set_type_hint (mw__main_window, GDK_WINDOW_TYPE_HINT_NORMAL);
+  gtk_window_set_type_hint (GTK_WINDOW(mw__main_window), GDK_WINDOW_TYPE_HINT_NORMAL);
 
   g_signal_connect (G_OBJECT (mw__main_window), "response",
                     G_CALLBACK (on_mw_response),
diff --git a/gap/gap_video_index_creator.c b/gap/gap_video_index_creator.c
index efe4c6c..b1bab0b 100644
--- a/gap/gap_video_index_creator.c
+++ b/gap/gap_video_index_creator.c
@@ -1022,6 +1022,7 @@ p_vindex_dialog(VindexValues *val_ptr)
         printf("p_vindex_dialog: PRAMETERS entered via dialog:\n");
         printf("  videofile: %s\n", &val_ptr->videofile[0]);
         printf("  decoder: %s\n", &val_ptr->preferred_decoder[0]);
+        printf("  ii_preferred_decoder:%d\n", (int)ii_preferred_decoder);
         printf("  seltrack: %d\n", (int)val_ptr->seltrack);
         printf("  mode: %d\n", (int)val_ptr->mode);
         printf("  percentage_smart_mode: %f\n", (float)val_ptr->percentage_smart_mode);
@@ -1287,7 +1288,7 @@ p_tree_fill (GapVideoIndexCreatorProgressParams *vipp, GapStoryVideoFileRef  *vr
   gtk_tree_selection_unselect_all(vipp->sel);
   if(treePathCurrent != NULL)
   {
-     gtk_tree_view_set_cursor(vipp->tv
+     gtk_tree_view_set_cursor(GTK_TREE_VIEW(vipp->tv)
                              ,treePathCurrent
                              ,NULL    /* focus_column */
                              ,FALSE   /* start_editing */
@@ -1642,3 +1643,4 @@ p_vid_progress_callback(gdouble progress
   /* return (TRUE); */ /* cancel video api if playback was stopped */
 
 }  /* end p_vid_progress_callback */
+
diff --git a/gap/gap_water_pattern.c b/gap/gap_water_pattern.c
index 0e3434e..b9eb0e8 100644
--- a/gap/gap_water_pattern.c
+++ b/gap/gap_water_pattern.c
@@ -904,8 +904,8 @@ p_cloud_layer_menu_callback(GtkWidget *widget, gint32 *cloudLayerId)
 
   if(gap_debug)
   {
-    printf("p_cloud_layer_menu_callback: cloudLayerAddr:%d value:%d\n"
-      ,(int)cloudLayerId
+    printf("p_cloud_layer_menu_callback: cloudLayerAddr:%ld value:%d\n"
+      ,(long)cloudLayerId
       ,(int)value
       );
   }
@@ -925,16 +925,19 @@ p_cloud_layer_menu_callback(GtkWidget *widget, gint32 *cloudLayerId)
  *
  */
 static gint
-p_pattern_layer_constrain(gint32 image_id, gint32 drawable_id, WaterPatternDialog *wcd)
+p_pattern_layer_constrain(gint32 image_id, gint32 drawable_id, gpointer data)
 {
   gint32 processedImageId;
+  WaterPatternDialog *wcd;
+  
+  wcd = (WaterPatternDialog *)data;
 
   if(gap_debug)
   {
-    printf("p_pattern_layer_constrain PROCEDURE image_id:%d drawable_id:%d wcd:%d\n"
+    printf("p_pattern_layer_constrain PROCEDURE image_id:%d drawable_id:%d wcd:%ld\n"
                           ,(int)image_id
                           ,(int)drawable_id
-                          ,(int)wcd
+                          ,(long)wcd
                           );
   }
 
@@ -1412,7 +1415,7 @@ do_dialog (WaterPatternDialog *wcd, waterpattern_val_t *cuvals)
   /* highlightOpacity spinbutton  */
   spinbutton_adj = gtk_adjustment_new (cuvals->highlightOpacity, 0.0, 100, 1.0, 10, 0);
   spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_adj), 1, 3);
-  gimp_help_set_help_data (spinbutton, _("The highlight strength (e.g. opacity)"), NULL);
+  gimp_help_set_help_data (spinbutton, _("The highlight strength (i.e. opacity)"), NULL);
   gtk_widget_show (spinbutton);
   gtk_table_attach (GTK_TABLE (table1), spinbutton, 3, 4, row, row+1,
                     (GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
@@ -1688,7 +1691,6 @@ run(const gchar *name
 
   gint32    l_image_id = -1;
   gint32    l_drawable_id = -1;
-  gint32    l_handled_drawable_id = -1;
 
 
 
@@ -1800,7 +1802,6 @@ run(const gchar *name
 
         gimp_image_undo_group_start (l_image_id);
         success = p_run_renderWaterPattern(l_drawable_id, &l_cuvals, ctxt);
-        l_handled_drawable_id = l_drawable_id;
         gimp_image_undo_group_end (l_image_id);
 
         if(success)
diff --git a/gap/gap_wr_color_balance.c b/gap/gap_wr_color_balance.c
index 11f6d42..a1e32f6 100644
--- a/gap/gap_wr_color_balance.c
+++ b/gap/gap_wr_color_balance.c
@@ -175,6 +175,10 @@ p_run_color_balance_tool(gint32 drawable_id, wr_color_balance_val_t *cuvals)
                              , cuvals->yellow_blue
                              );
 
+  if(gap_debug)
+  {
+    printf("p_run_color_balance_tool: success:%d\n", (int)success);
+  }
 
 }
 
@@ -528,7 +532,6 @@ do_dialog (wr_color_balance_val_t *cuvals)
   GtkWidget *frame1;
   GtkWidget *hbox1;
   GtkWidget *vbox1;
-  GtkWidget *label1;
   GSList *vbox1_group = NULL;
   GtkWidget *radiobutton1;
   GtkWidget *radiobutton2;
diff --git a/gap/gap_wr_color_curve.c b/gap/gap_wr_color_curve.c
index df56af5..077b1ce 100644
--- a/gap/gap_wr_color_curve.c
+++ b/gap/gap_wr_color_curve.c
@@ -703,6 +703,10 @@ p_read_samples(CurveParserContext *cpc)
   p_skip_whitespace(cpc);
 
   intValue = p_read_gint32_value(cpc);
+  if(gap_debug)
+  {
+    printf("p_read_samples START intValue:%d\n", (int)intValue);
+  }
   cpc->point_index = 0;
   while(*cpc->ptr != '\0')
   {
@@ -745,7 +749,7 @@ p_read_samples(CurveParserContext *cpc)
  * p_read_curve
  * ----------------------------------------
  * read curve description 
- *  this implementation read only the expected 256 samples and ignores (e.g. skips) other parts
+ *  this implementation read only the expected 256 samples and ignores (i.e. skips) other parts
  *  of the curve description
  * the scan ptr is set to the character after the closing bracket.
  */
diff --git a/gap/gap_wr_resynth.c b/gap/gap_wr_resynth.c
index 53deccd..74670fc 100644
--- a/gap/gap_wr_resynth.c
+++ b/gap/gap_wr_resynth.c
@@ -542,7 +542,6 @@ p_pdb_call_resynthesizer(gint32 image_id, gint32 layer_id, gint32 corpus_layer_i
    char            *l_called_proc;
    GimpParam       *return_vals;
    int              nreturn_vals;
-   gint             nparams_resynth_s;
    gboolean         foundResynthS;
 
    l_called_proc = PLUG_IN_RESYNTHESIZER_WITH_SEED;
@@ -640,7 +639,7 @@ p_create_corpus_layer(gint32 image_id, gint32 drawable_id, TransValues *val_ptr)
   gint32 channel_2_id;
   GimpRGB  bck_color;
   GimpRGB  white_opaque_color;
-  gboolean has_selection;
+  /* gboolean has_selection; */
   gboolean non_empty;
   gint     x1, y1, x2, y2;
   gint32   active_layer_stackposition;
@@ -671,7 +670,7 @@ p_create_corpus_layer(gint32 image_id, gint32 drawable_id, TransValues *val_ptr)
 
   gimp_selection_invert(dup_image_id);
 
-  has_selection  = gimp_selection_bounds(dup_image_id, &non_empty, &x1, &y1, &x2, &y2);
+  /* has_selection  = */ gimp_selection_bounds(dup_image_id, &non_empty, &x1, &y1, &x2, &y2);
   gimp_image_crop(dup_image_id, (x2 - x1), (y2 - y1), x1, y1);
 
   gimp_selection_invert(dup_image_id);
@@ -747,18 +746,22 @@ p_process_layer(gint32 image_id, gint32 drawable_id, TransValues *val_ptr)
   {
     if(gap_debug)
     {
-      printf("creating alt_selection: %d\n", (int)val_ptr->alt_selection);
+      printf("p_process_layer creating alt_selection: %d\n", (int)val_ptr->alt_selection);
     }
     alt_selection_success = p_set_alt_selection(image_id, drawable_id, val_ptr);
   }
 
   has_selection  = gimp_selection_bounds(image_id, &non_empty, &x1, &y1, &x2, &y2);
+  if(gap_debug)
+  {
+    printf("p_process_layer has_selection: %d\n", (int)has_selection);
+  }
 
   /* here the action starts, we create the corpus_layer_id that builds the reference pattern
    * (the corpus is created in a spearate image and has an expanded selection
    * that excludes the unwanted parts)
-   * then start the resynthesizer plug-in to replace selcted (e.g. unwanted parts) of the
-   * processed layer (e.g. drawable_id)
+   * then start the resynthesizer plug-in to replace selected (i.e. unwanted parts) of the
+   * processed layer (i.e. drawable_id)
    */
   if (non_empty)
   {
@@ -790,4 +793,3 @@ p_process_layer(gint32 image_id, gint32 drawable_id, TransValues *val_ptr)
   return (trans_drawable_id);
 
 }  /* end p_process_layer */
-
diff --git a/gap/gap_wr_trans.c b/gap/gap_wr_trans.c
index 5d343f7..3efda69 100644
--- a/gap/gap_wr_trans.c
+++ b/gap/gap_wr_trans.c
@@ -76,7 +76,7 @@ static TransValues glob_vals =
   0.0           /* rotation angle in degree */
 };
 
-static void  iter_query ();
+
 static void  query (void);
 static void  run (const gchar *name,          /* name of plugin */
      gint nparams,               /* number of in-paramters */
@@ -375,11 +375,8 @@ run (const gchar *name,          /* name of plugin */
   {
     if(gimp_drawable_is_layer(drawable_id))
     {
-      gboolean run_flag;
-      
       /* Initial values */
       glob_vals.angle_deg = 0;
-      run_flag = TRUE;
 
       /* Possibly retrieve data from a previous run */
       gimp_get_data (name, &glob_vals);
@@ -389,7 +386,7 @@ run (const gchar *name,          /* name of plugin */
         case GIMP_RUN_INTERACTIVE:
  
           /* Get information from the dialog */
-          run_flag = p_dialog(trans_mode, &glob_vals);
+          p_dialog(trans_mode, &glob_vals);
           break;
 
         case GIMP_RUN_NONINTERACTIVE:
@@ -478,7 +475,7 @@ p_transform_layer(gint32 image_id, gint32 drawable_id, GapTransLayerMode trans_m
 {
   gboolean auto_center;
   gdouble  axis;
-  gboolean has_selection;
+  /*gboolean has_selection; */
   gboolean non_empty;
   gint     x1, y1, x2, y2;
   gint32   sav_selection_id;
@@ -489,7 +486,7 @@ p_transform_layer(gint32 image_id, gint32 drawable_id, GapTransLayerMode trans_m
   gimp_image_undo_group_start(image_id);
   
   sav_selection_id = -1;
-  has_selection  = gimp_selection_bounds(image_id, &non_empty, &x1, &y1, &x2, &y2);
+  /*has_selection  = */ gimp_selection_bounds(image_id, &non_empty, &x1, &y1, &x2, &y2);
     
   center_x = gimp_drawable_width(drawable_id) / 2;
   center_y = gimp_drawable_height(drawable_id) / 2;
@@ -612,7 +609,6 @@ p_dialog (GapTransLayerMode trans_mode, TransValues *val_ptr)
 {
   GtkWidget *dialog;
   GtkWidget *main_vbox;
-  GtkWidget *preview;
   GtkWidget *table;
   GtkObject *adj;
   gboolean   run;
diff --git a/libgapbase/gap_base.c b/libgapbase/gap_base.c
index 4557878..a50a017 100644
--- a/libgapbase/gap_base.c
+++ b/libgapbase/gap_base.c
@@ -315,7 +315,6 @@ gap_base_gdouble_to_ascii_string(gdouble value, gint precision_digits)
   
   gchar l_dbl_str[G_ASCII_DTOSTR_BUF_SIZE];
   gchar l_fmt_str[20];
-  gint  l_len;
 
   g_snprintf(l_fmt_str, sizeof(l_fmt_str), "%%.%df", (int)precision_digits);
   g_ascii_formatd(l_dbl_str, sizeof(l_dbl_str), l_fmt_str, value);
@@ -735,7 +734,7 @@ gap_base_get_thread_id()
   threadId = pthread_self();
   if(gap_debug)
   {
-    printf("pthread_self threadId:%lld\n", threadId);
+    printf("pthread_self threadId:%lld\n", (long long int)threadId);
   }
 #endif
 
diff --git a/libgapbase/gap_timm.c b/libgapbase/gap_timm.c
index 3d020f6..c1f4266 100644
--- a/libgapbase/gap_timm.c
+++ b/libgapbase/gap_timm.c
@@ -426,10 +426,10 @@ gap_timm_print_statistics()
       , (int) ii
       , &timmData.tab[ii].funcName[0]
       , (int) timmData.tab[ii].numberOfCallsFinished
-      , timmData.tab[ii].summaryDuration
-      , timmData.tab[ii].minDuration
-      , timmData.tab[ii].maxDuration
-      , avgDuration
+      , (long long unsigned int)timmData.tab[ii].summaryDuration
+      , (long long unsigned int)timmData.tab[ii].minDuration
+      , (long long unsigned int)timmData.tab[ii].maxDuration
+      , (long long unsigned int)avgDuration
       );
     if(timmData.tab[ii].errorFlag)
     {
@@ -556,14 +556,11 @@ gap_timm_print_record(GapTimmRecord *timmp, const char *functionName)
     
   printf("tim: %-65.65s calls:%06u sum:%llu min:%llu max:%llu avg:%llu usecs\n"
       , functionName
-      , (int) timmp->numberOfCalls
-      , timmp->summaryDuration
-      , timmp->minDuration
-      , timmp->maxDuration
-      , avgDuration
+      , timmp->numberOfCalls
+      , (long long unsigned int) timmp->summaryDuration
+      , (long long unsigned int) timmp->minDuration
+      , (long long unsigned int) timmp->maxDuration
+      , (long long unsigned int)avgDuration
       );
 
 }  /* end gap_timm_print_record */
-
-
-
diff --git a/libgapbase/gap_timm.h b/libgapbase/gap_timm.h
index bfb3a60..084b1e4 100644
--- a/libgapbase/gap_timm.h
+++ b/libgapbase/gap_timm.h
@@ -81,8 +81,11 @@ typedef struct GapTimmRecord
 
 /* macros to enable runtime recording function calls at compiletime.
  * in case GAP_RUNTIME_RECORDING_LOCK is not defined at compiletime
- * the macros expand to nothing, e.g the runtime recording function calls
+ * the macros expand to nothing, so that the runtime recording function calls
  * are not compiled at all.
+ * 2014.03.19  GAP_TIMM_GET_FUNCTION_ID now expands to dummy code
+ *             in case GAP_RUNTIME_RECORDING_LOCK is not defined
+ *             (this eliminates compiler warnings)
  * Note that the xx_FUNCTION macros call g_mutex_lock
  */
 
@@ -95,7 +98,7 @@ typedef struct GapTimmRecord
 
 #else
 
-#define GAP_TIMM_GET_FUNCTION_ID(funcId, functionName)
+#define GAP_TIMM_GET_FUNCTION_ID(funcId, functionName)  if(funcId < 0) { funcId = 0; }
 #define GAP_TIMM_START_FUNCTION(funcId)
 #define GAP_TIMM_STOP_FUNCTION(funcId)
 #define GAP_TIMM_PRINT_FUNCTION_STATISTICS()
diff --git a/libgapbase/gap_val_file.c b/libgapbase/gap_val_file.c
index 9ff431f..6c1cd92 100644
--- a/libgapbase/gap_val_file.c
+++ b/libgapbase/gap_val_file.c
@@ -273,7 +273,7 @@ p_write_keylist_value(FILE *fp, GapValKeyList *keyptr, const char *term_str)
         val_ptr = (gint64 *)keyptr->val_ptr;
         l_str = g_strdup_printf("%s%lld%s %s"
                , keyptr->keyword   /* "(keyword " */
-               , *val_ptr          /* value */
+               , (long long int)*val_ptr          /* value */
                , term_ptr
                , keyptr->comment
                );
diff --git a/libgapvidapi/gap_vid_api.c b/libgapvidapi/gap_vid_api.c
index f619832..0c50aae 100644
--- a/libgapvidapi/gap_vid_api.c
+++ b/libgapvidapi/gap_vid_api.c
@@ -233,13 +233,13 @@ GVA_debug_print_fcache(t_GVA_Handle *gvahand)
     fc_ptr = (t_GVA_Frame_Cache_Elem  *)fcache->fc_current;
     for(ii=0; ii < fcache->frame_cache_size; ii++)
     {
-       printf("  [%d]  ID:%d framenumber: %d  (my_adr: %d  next:%d  prev:%d)\n"
+       printf("  [%d]  ID:%d framenumber: %d  (my_adr: %ld  next:%ld  prev:%ld)\n"
              , (int)ii
              , (int)fc_ptr->id
              , (int)fc_ptr->framenumber
-             , (int)fc_ptr
-             , (int)fc_ptr->next
-             , (int)fc_ptr->prev
+             , (long)fc_ptr
+             , (long)fc_ptr->next
+             , (long)fc_ptr->prev
              );
 
       fc_ptr = (t_GVA_Frame_Cache_Elem  *)fc_ptr->prev;
@@ -506,7 +506,7 @@ GVA_set_fcache_size(t_GVA_Handle *gvahand
 /* -------------------------------
  * GVA_get_fcache_size_in_elements
  * -------------------------------
- * return internal frame cache allocation size in number of elements (e.g. frames)
+ * return internal frame cache allocation size in number of elements (i.e. frames)
  * note that the fcache is already fully allocated at open time, therefore
  * the number of actual cached frames may be smaller than the returned number.
  */
@@ -830,8 +830,8 @@ GVA_search_fcache_and_get_frame_as_gimp_layer_or_rgb888(t_GVA_Handle *gvahand
 {
   t_GVA_Frame_Cache *fcache;
   t_GVA_Frame_Cache_Elem  *fc_ptr;
-  gint32                   l_threshold;
-  gint32                   l_mix_threshold;
+  /*  gint32                   l_threshold; */
+  /*  gint32                   l_mix_threshold; */
 
   static gint32 funcId = -1;
   static gint32 funcIdMemcpy = -1;
@@ -865,8 +865,9 @@ GVA_search_fcache_and_get_frame_as_gimp_layer_or_rgb888(t_GVA_Handle *gvahand
 
   /* expand threshold range from 0.0-1.0  to 0 - MIX_MAX_THRESHOLD */
   threshold = CLAMP(threshold, 0.0, 1.0);
-  l_threshold = (gdouble)MIX_MAX_THRESHOLD * (threshold * threshold * threshold);
-  l_mix_threshold = CLAMP((gint32)l_threshold, 0, MIX_MAX_THRESHOLD);
+
+  /*  l_threshold = (gdouble)MIX_MAX_THRESHOLD * (threshold * threshold * threshold); */
+  /* l_mix_threshold = CLAMP((gint32)l_threshold, 0, MIX_MAX_THRESHOLD); */
 
   GVA_fcache_mutex_lock (gvahand);
 
@@ -1716,15 +1717,15 @@ p_gva_worker_close(t_GVA_Handle  *gvahand)
       
       if(gap_debug)
       {
-        printf("GVA: gvahand:%d p_gva_worker_close: before CLOSE %s with decoder:%s\n"
-           , (int)gvahand
+        printf("GVA: gvahand:%ld p_gva_worker_close: before CLOSE %s with decoder:%s\n"
+           , (long)gvahand
            , gvahand->filename
            , dec_elem->decoder_name
            );
       }
 
       /* log mutex wait statistics (only in case compiled with runtime recording) */
-      nameMutexLockStats = g_strdup_printf("... close gvahand:%d fcacheMutexLockStatistic ", (int)gvahand);
+      nameMutexLockStats = g_strdup_printf("... close gvahand:%ld fcacheMutexLockStatistic ", (long)gvahand);
       GVA_copy_or_delace_print_statistics();
       GAP_TIMM_PRINT_RECORD(&gvahand->fcacheMutexLockStats, nameMutexLockStats);
       g_free(nameMutexLockStats);
@@ -1733,8 +1734,8 @@ p_gva_worker_close(t_GVA_Handle  *gvahand)
 
       if(gap_debug)
       {
-        printf("GVA: gvahand:%d p_gva_worker_close: after CLOSE %s with decoder:%s\n"
-           , (int)gvahand
+        printf("GVA: gvahand:%ld p_gva_worker_close: after CLOSE %s with decoder:%s\n"
+           , (long)gvahand
            , gvahand->filename
            , dec_elem->decoder_name
            );
@@ -2273,7 +2274,7 @@ GVA_open_read_pref(const char *filename, gint32 vid_track, gint32 aud_track
                                  ,disable_mmx
                                  );
 
-  if(gap_debug) printf("GVA_open_read_pref: END handle:%d\n", (int)handle);
+  if(gap_debug) printf("GVA_open_read_pref: END handle:%ld\n", (long)handle);
 
   return(handle);
 }
@@ -2297,7 +2298,10 @@ GVA_open_read(const char *filename, gint32 vid_track, gint32 aud_track)
     g_free(l_env_preferred_decoder);
   }
 
-  if(gap_debug) printf("GVA_open_read: END handle:%d\n", (int)handle);
+  if(gap_debug)
+  {
+    printf("GVA_open_read: END handle:%ld\n", (long)handle);
+  }
 
   return(handle);
 }
@@ -2305,9 +2309,16 @@ GVA_open_read(const char *filename, gint32 vid_track, gint32 aud_track)
 void
 GVA_close(t_GVA_Handle  *gvahand)
 {
-  if(gap_debug) printf("GVA_close: START handle:%d\n", (int)gvahand);
+  if(gap_debug)
+  {
+    printf("GVA_close: START handle:%ld\n", (long)gvahand);
+  }
   p_gva_worker_close(gvahand);
-  if(gap_debug) printf("GVA_close: END\n");
+
+  if(gap_debug)
+  {
+    printf("GVA_close: END\n");
+  }
 }
 
 t_GVA_RetCode
@@ -2322,7 +2333,7 @@ GVA_get_next_frame(t_GVA_Handle  *gvahand)
 
   if(gap_debug)
   {
-    printf("GVA_get_next_frame: START handle:%d\n", (int)gvahand);
+    printf("GVA_get_next_frame: START handle:%ld\n", (long)gvahand);
   }
 
   l_rc = p_gva_worker_get_next_frame(gvahand);
@@ -2350,8 +2361,8 @@ GVA_seek_frame(t_GVA_Handle  *gvahand, gdouble pos, t_GVA_PosUnit pos_unit)
 
   if(gap_debug)
   {
-    printf("GVA_seek_frame: START handle:%d, pos%.4f unit:%d\n"
-      , (int)gvahand, (float)pos, (int)pos_unit);
+    printf("GVA_seek_frame: START handle:%ld, pos%.4f unit:%d\n"
+      , (long)gvahand, (float)pos, (int)pos_unit);
   }
 
   l_rc = p_gva_worker_seek_frame(gvahand, pos, pos_unit);
@@ -2372,9 +2383,15 @@ GVA_seek_audio(t_GVA_Handle  *gvahand, gdouble pos, t_GVA_PosUnit pos_unit)
 {
   t_GVA_RetCode l_rc;
 
-  if(gap_debug) printf("GVA_seek_audio: START handle:%d\n", (int)gvahand);
+  if(gap_debug)
+  {
+    printf("GVA_seek_audio: START handle:%ld\n", (long)gvahand);
+  }
   l_rc = p_gva_worker_seek_audio(gvahand, pos, pos_unit);
-  if(gap_debug) printf("GVA_seek_audio: END rc:%d\n", (int)l_rc);
+  if(gap_debug) 
+  {
+   printf("GVA_seek_audio: END rc:%d\n", (int)l_rc);
+  }
 
   return(l_rc);
 }
@@ -2389,7 +2406,15 @@ GVA_get_audio(t_GVA_Handle  *gvahand
 {
   t_GVA_RetCode l_rc;
 
-  if(gap_debug) printf("GVA_get_audio: START handle:%d, ch:%d samples:%d mod:%d\n", (int)gvahand, 
(int)channel, (int)samples, (int)mode_flag);
+  if(gap_debug)
+  {
+    printf("GVA_get_audio: START handle:%ld, ch:%d samples:%d mod:%d\n"
+        , (long)gvahand
+        , (int)channel
+        , (int)samples
+        , (int)mode_flag
+        );
+  }
   l_rc = p_gva_worker_get_audio(gvahand
                                ,output_i
                                ,channel
@@ -2406,9 +2431,15 @@ GVA_count_frames(t_GVA_Handle  *gvahand)
 {
   t_GVA_RetCode l_rc;
 
-  if(gap_debug) printf("GVA_count_frames: START handle:%d\n", (int)gvahand);
+  if(gap_debug)
+  {
+    printf("GVA_count_frames: START handle:%ld\n", (long)gvahand);
+  }
   l_rc = p_gva_worker_count_frames(gvahand);
-  if(gap_debug) printf("GVA_count_frames: END rc:%d\n", (int)l_rc);
+  if(gap_debug)
+  {
+    printf("GVA_count_frames: END rc:%d\n", (int)l_rc);
+  }
 
   return(l_rc);
 }
@@ -2418,9 +2449,15 @@ GVA_check_seek_support(t_GVA_Handle  *gvahand)
 {
   t_GVA_SeekSupport l_rc;
 
-  if(gap_debug) printf("GVA_check_seek_support: START handle:%d\n", (int)gvahand);
+  if(gap_debug)
+  {
+    printf("GVA_check_seek_support: START handle:%ld\n", (long)gvahand);
+  }
   l_rc = p_gva_worker_check_seek_support(gvahand);
-  if(gap_debug) printf("GVA_check_seek_support: END rc:%d\n", (int)l_rc);
+  if(gap_debug)
+  {
+    printf("GVA_check_seek_support: END rc:%d\n", (int)l_rc);
+  }
 
   return(l_rc);
 }
@@ -2434,12 +2471,16 @@ GVA_get_video_chunk(t_GVA_Handle  *gvahand
 {
   t_GVA_RetCode l_rc;
 
-  if(gap_debug) printf("GVA_get_video_chunk: START handle:%d, chunk addr:%d (max_size:%d) frame_nr:%d\n"
-                      , (int)gvahand
-                      , (int)chunk
+  if(gap_debug)
+  {
+    printf("GVA_get_video_chunk: START handle:%ld, chunk addr:%ld (max_size:%d) frame_nr:%d\n"
+                      , (long)gvahand
+                      , (long)chunk
                       , (int)max_size
                       , (int)frame_nr
                       );
+  }
+  
   l_rc = p_gva_worker_get_video_chunk(gvahand, frame_nr, chunk, size, max_size);
   if(gap_debug) printf("GVA_get_video_chunk: END rc:%d size:%d\n", (int)l_rc, (int)*size);
 
@@ -2452,7 +2493,10 @@ GVA_has_video_chunk_proc(t_GVA_Handle  *gvahand)
 {
   gboolean l_rc;
 
-  if(gap_debug) printf("GVA_has_video_chunk_proc: START handle:%d\n", (int)gvahand);
+  if(gap_debug)
+  {
+    printf("GVA_has_video_chunk_proc: START handle:%ld\n", (long)gvahand);
+  }
 
   l_rc = FALSE;
   if(gvahand)
@@ -2485,8 +2529,8 @@ GVA_get_codec_name(t_GVA_Handle  *gvahand
 
   if(gap_debug)
   {
-    printf("GVA_get_video_chunk: START handle:%d, codec_type:%d track_nr:%d\n"
-                      , (int)gvahand
+    printf("GVA_get_video_chunk: START handle:%ld, codec_type:%d track_nr:%d\n"
+                      , (long)gvahand
                       , (int)codec_type
                       , (int)track_nr
                       );
@@ -2865,13 +2909,11 @@ p_gva_deinterlace_drawable (GimpDrawable *drawable, gint32 deinterlace, gdouble
 {
   GimpPixelRgn  srcPR, destPR;
   guchar       *dest;
-  guchar       *dest_buffer = NULL;
   guchar       *upper;
   guchar       *lower;
-  gint          row, col;
+  gint          row;
   gint          x, y;
   gint          width, height;
-  gint          bytes;
   gint x2, y2;
   gint32  l_row_bytewidth;
   gint32  l_interpolate_flag;
@@ -2881,7 +2923,6 @@ p_gva_deinterlace_drawable (GimpDrawable *drawable, gint32 deinterlace, gdouble
   l_interpolate_flag = gva_delace_calculate_interpolate_flag(deinterlace);
   l_mix_threshold = gva_delace_calculate_mix_threshold(threshold);
 
-  bytes = drawable->bpp;
 
   gimp_drawable_mask_bounds (drawable->drawable_id, &x, &y, &x2, &y2);
   width  = x2 - x;
@@ -3075,8 +3116,8 @@ GVA_frame_to_gimp_layer_2(t_GVA_Handle *gvahand
   GimpPixelRgn pixel_rgn;
   GimpDrawable *drawable;
   gint32 l_new_layer_id;
-  gint32 l_threshold;
-  gint32 l_mix_threshold;
+  /* gint32 l_threshold; */
+  /* gint32 l_mix_threshold; */
 
   static gchar *odd_even_tab[8] = {"\0", "_odd", "_even", "_odd", "_even", "\0", "\0", "\0" };
 
@@ -3104,8 +3145,8 @@ GVA_frame_to_gimp_layer_2(t_GVA_Handle *gvahand
 
   /* expand threshold range from 0.0-1.0  to 0 - MIX_MAX_THRESHOLD */
   threshold = CLAMP(threshold, 0.0, 1.0);
-  l_threshold = (gdouble)MIX_MAX_THRESHOLD * (threshold * threshold * threshold);
-  l_mix_threshold = CLAMP((gint32)l_threshold, 0, MIX_MAX_THRESHOLD);
+  /* l_threshold = (gdouble)MIX_MAX_THRESHOLD * (threshold * threshold * threshold); */
+  /* l_mix_threshold = CLAMP((gint32)l_threshold, 0, MIX_MAX_THRESHOLD); */
 
 
   if(p_check_image_is_alive(*image_id))
diff --git a/libgapvidapi/gap_vid_api_ffmpeg.c b/libgapvidapi/gap_vid_api_ffmpeg.c
index d7c05d2..8e0d363 100644
--- a/libgapvidapi/gap_vid_api_ffmpeg.c
+++ b/libgapvidapi/gap_vid_api_ffmpeg.c
@@ -563,15 +563,15 @@ p_wrapper_ffmpeg_open_read(char *filename, t_GVA_Handle *gvahand)
   if(gap_debug)
   {
      printf("gvahand->width: %d  gvahand->height: %d aspect_ratio:%f\n", (int)gvahand->width , 
(int)gvahand->height, (float)gvahand->aspect_ratio);
-     printf("picture_rgb: data[0]: %d linesize[0]: %d\n", (int)handle->picture_rgb->data[0], 
(int)handle->picture_rgb->linesize[0]);
-     printf("picture_rgb: data[1]: %d linesize[1]: %d\n", (int)handle->picture_rgb->data[1], 
(int)handle->picture_rgb->linesize[1]);
-     printf("picture_rgb: data[2]: %d linesize[2]: %d\n", (int)handle->picture_rgb->data[2], 
(int)handle->picture_rgb->linesize[2]);
-     printf("picture_rgb: data[3]: %d linesize[3]: %d\n", (int)handle->picture_rgb->data[3], 
(int)handle->picture_rgb->linesize[3]);
-
-     printf("picture_yuv: data[0]: %d linesize[0]: %d\n", (int)handle->picture_yuv->data[0], 
(int)handle->picture_yuv->linesize[0]);
-     printf("picture_yuv: data[1]: %d linesize[1]: %d\n", (int)handle->picture_yuv->data[1], 
(int)handle->picture_yuv->linesize[1]);
-     printf("picture_yuv: data[2]: %d linesize[2]: %d\n", (int)handle->picture_yuv->data[2], 
(int)handle->picture_yuv->linesize[2]);
-     printf("picture_yuv: data[3]: %d linesize[3]: %d\n", (int)handle->picture_yuv->data[3], 
(int)handle->picture_yuv->linesize[3]);
+     printf("picture_rgb: data[0]: %ld linesize[0]: %d\n", (long)handle->picture_rgb->data[0], 
(int)handle->picture_rgb->linesize[0]);
+     printf("picture_rgb: data[1]: %ld linesize[1]: %d\n", (long)handle->picture_rgb->data[1], 
(int)handle->picture_rgb->linesize[1]);
+     printf("picture_rgb: data[2]: %ld linesize[2]: %d\n", (long)handle->picture_rgb->data[2], 
(int)handle->picture_rgb->linesize[2]);
+     printf("picture_rgb: data[3]: %ld linesize[3]: %d\n", (long)handle->picture_rgb->data[3], 
(int)handle->picture_rgb->linesize[3]);
+
+     printf("picture_yuv: data[0]: %ld linesize[0]: %d\n", (long)handle->picture_yuv->data[0], 
(int)handle->picture_yuv->linesize[0]);
+     printf("picture_yuv: data[1]: %ld linesize[1]: %d\n", (long)handle->picture_yuv->data[1], 
(int)handle->picture_yuv->linesize[1]);
+     printf("picture_yuv: data[2]: %ld linesize[2]: %d\n", (long)handle->picture_yuv->data[2], 
(int)handle->picture_yuv->linesize[2]);
+     printf("picture_yuv: data[3]: %ld linesize[3]: %d\n", (long)handle->picture_yuv->data[3], 
(int)handle->picture_yuv->linesize[3]);
      printf("handle->yuv_buff_pix_fmt: %d\n", (int)handle->yuv_buff_pix_fmt);
   }
 
@@ -823,9 +823,9 @@ p_wrapper_ffmpeg_get_video_chunk(t_GVA_Handle  *gvahand
       }
     }
 
-    printf("p_wrapper_ffmpeg_get_video_chunk: chunk:%d chunk_ptr:%d, chunk_len:%d vcodec_name:%s\n"
-      ,(int)chunk
-      ,(int)handle->chunk_ptr
+    printf("p_wrapper_ffmpeg_get_video_chunk: chunk:%ld chunk_ptr:%ld, chunk_len:%d vcodec_name:%s\n"
+      ,(long)chunk
+      ,(long)handle->chunk_ptr
       ,(int)handle->chunk_len
       ,vcodec_name
       );
@@ -860,7 +860,7 @@ p_wrapper_ffmpeg_get_next_frame(t_GVA_Handle *gvahand)
  *
  * restrictions:
  *  only the part for input strams is supported.
- *  (e.g. write_flag is ignored here)
+ *  (i.e. write_flag is ignored here)
  *  includes some chacks for inplausible results.
  *
  * the internal calculation  looks like this:
@@ -892,10 +892,10 @@ p_url_ftell(ByteIOContext *s)
   }
   else
   {
-    printf(" ** ERROR current buf_ptr:%d  points outside of the buffer (start: %d   end:%d)\n"
-       ,(int)s->buf_ptr
-       ,(int)s->buffer
-       ,(int)s->buf_end
+    printf(" ** ERROR current buf_ptr:%ld  points outside of the buffer (start: %ld   end:%ld)\n"
+       ,(long)s->buf_ptr
+       ,(long)s->buffer
+       ,(long)s->buf_end
        );
   }
 
@@ -909,17 +909,17 @@ p_url_ftell(ByteIOContext *s)
 
   currentOffsetInStream = bufferStartOffsetInStream + bytesAlreadyHandledInBuffer;
 
-  printf("P_URL_FTELL: url64:%lld  pos: %lld, wr_flag:%d, buffer:%d buf_end:%d buf_ptr:%d\n"
+  printf("P_URL_FTELL: url64:%lld  pos: %lld, wr_flag:%d, buffer:%ld buf_end:%ld buf_ptr:%ld\n"
          "  bufferStartOffsetInStream:%lld, bytesReadInBuffer:%lld bytesAlreadyHandledInBuffer:%lld\n\n"
-         ,currentOffsetInStream
-         ,s->pos
+         ,(long long int)currentOffsetInStream
+         ,(long long int)s->pos
          ,(int)s->write_flag
-         ,(int)s->buffer
-         ,(int)s->buf_end
-         ,(int)s->buf_ptr
-         ,bufferStartOffsetInStream
-         ,bytesReadInBuffer
-         ,bytesAlreadyHandledInBuffer
+         ,(long)s->buffer
+         ,(long)s->buf_end
+         ,(long)s->buf_ptr
+         ,(long long int)bufferStartOffsetInStream
+         ,(long long int)bytesReadInBuffer
+         ,(long long int)bytesAlreadyHandledInBuffer
          );
 
   return (currentOffsetInStream);
@@ -1089,21 +1089,23 @@ p_private_ffmpeg_get_next_frame(t_GVA_Handle *gvahand, gboolean do_copy_raw_chun
 
 
       if(gap_debug)
-      {  printf("using Packet data:%d size:%d  dts:%lld  pts:%lld  AV_NOPTS_VALUE:%lld\n"
-                                 ,(int)handle->vid_pkt.data
+      {
+        printf("using Packet data:%ld size:%d (%d)  dts:%lld  pts:%lld  AV_NOPTS_VALUE:%lld\n"
+                                 ,(long)handle->vid_pkt.data
                                  ,(int)handle->vid_pkt.size
-                                 , handle->vid_pkt.dts
-                                 , handle->vid_pkt.pts
-                                 , AV_NOPTS_VALUE
+                                 ,(int)l_pkt_size
+                                 ,(long long int)handle->vid_pkt.dts
+                                 ,(long long int)handle->vid_pkt.pts
+                                 ,(long long int) AV_NOPTS_VALUE
                                  );
       }
     }
 
     if (gap_debug)
     {
-      printf("before %s: inbuf_ptr:%d inbuf_len:%d  USING FFMPEG-%s\n"
+      printf("before %s: inbuf_ptr:%ld inbuf_len:%d  USING FFMPEG-%s\n"
              , PROCNAME_AVCODEC_DECODE_VIDEO
-             , (int)handle->inbuf_ptr
+             , (long)handle->inbuf_ptr
              , (int)handle->inbuf_len
              , GAP_FFMPEG_VERSION_STRING
              );
@@ -1131,8 +1133,8 @@ p_private_ffmpeg_get_next_frame(t_GVA_Handle *gvahand, gboolean do_copy_raw_chun
         memcpy(handle->chunk_ptr, handle->inbuf_ptr, handle->chunk_len);
         if (gap_debug)
         {
-          printf("copy potential raw chunk: chunk_ptr:%d chunk_len:%d\n",
-                 (int)handle->chunk_ptr,
+          printf("copy potential raw chunk: chunk_ptr:%ld chunk_len:%d\n",
+                 (long)handle->chunk_ptr,
                  (int)handle->chunk_len);
         }
       }
@@ -1169,15 +1171,15 @@ p_private_ffmpeg_get_next_frame(t_GVA_Handle *gvahand, gboolean do_copy_raw_chun
     {
       
       printf("get_next_frame(call:%d): "
-             "curr_frame_nr:%d Pkt data:%d size:%d  dts:%lld pts:%lld l_len:%d got_pic:%d\n"
+             "curr_frame_nr:%d Pkt data:%ld size:%d  dts:%lld pts:%lld l_len:%d got_pic:%d\n"
          ,(int)ls_callNumber
          ,(int) gvahand->current_frame_nr
-         ,(int)handle->vid_pkt.data
+         ,(long)handle->vid_pkt.data
          ,(int)handle->vid_pkt.size
-         , handle->vid_pkt.dts
-         , handle->vid_pkt.pts
-         , (int)l_len
-         , (int)l_got_picture
+         ,(long long int)handle->vid_pkt.dts
+         ,(long long int)handle->vid_pkt.pts
+         ,(int)l_len
+         ,(int)l_got_picture
          );
     }
 
@@ -1215,7 +1217,7 @@ p_private_ffmpeg_get_next_frame(t_GVA_Handle *gvahand, gboolean do_copy_raw_chun
        printf("get_next_frame: %s returned ERROR, "
               "discarding packet dts:%lld and continueAfterReadErrors)\n"
            , PROCNAME_AVCODEC_DECODE_VIDEO
-           , handle->vid_pkt.dts
+           , (long long int)handle->vid_pkt.dts
            );
    
        handle->vid_pkt.size = 0;             /* set empty packet status */
@@ -1269,11 +1271,11 @@ p_private_ffmpeg_get_next_frame(t_GVA_Handle *gvahand, gboolean do_copy_raw_chun
         /* log information that could be relevant for redesign of VINDEX creation */
         printf("GOT PICTURE current_seek_nr:%06d   pp_prev_offset:%lld url_offset:%lld keyflag:%d dts:%lld 
dts1:%lld flen16:%d len:%d\n"
                   , (int)gvahand->current_seek_nr
-                  , handle->prev_url_offset[MAX_PREV_OFFSET -1]
-                  , l_record_url_offset
+                  , (long long int)handle->prev_url_offset[MAX_PREV_OFFSET -1]
+                  , (long long int)l_record_url_offset
                   ,  (handle->vid_pkt.flags & AV_PKT_FLAG_KEY)
-                  , handle->vid_pkt.dts
-                  , handle->pkt1_dts
+                  , (long long int)handle->vid_pkt.dts
+                  , (long long int)handle->pkt1_dts
                   ,(int)l_frame_len
                   ,(int)l_len
                   );
@@ -1483,7 +1485,7 @@ p_private_ffmpeg_get_next_frame(t_GVA_Handle *gvahand, gboolean do_copy_raw_chun
     if(gap_debug)
     {
       printf("AVFORMAT: get_next_frame timecode: %lld current_frame_nr:%d\n"
-                  , handle->vid_pkt.dts
+                  , (long long int)handle->vid_pkt.dts
                   , gvahand->current_frame_nr
                   );
     }
@@ -1578,7 +1580,7 @@ static void p_reset_proberead_results(t_GVA_ffmpeg*  handle)
  * this test analyzes the required settings
  * for native timebased seek.
  * further it tries to findout if this fast seek
- * method works (e.g. is able to perform frame exact positioning
+ * method works (i.e. is able to perform frame exact positioning
  * that may fail for videofiles with variable frametiming
  * or have read errors).
  * Note that this check is no 100% guarantee but is able
@@ -2303,11 +2305,11 @@ p_seek_private(t_GVA_Handle *gvahand, gdouble pos, t_GVA_PosUnit pos_unit)
              {
                printf("SEEK: USING_INDEX: ofs_tab[%d]: ofs64: %lld seek_nr:%d flen:%d chk:%d dts:%lld 
DTS_USABLE:%d NLOOPS:%d\n"
                , (int)l_idx
-               , vindex->ofs_tab[l_idx].uni.offset_gint64
+               , (long long int)vindex->ofs_tab[l_idx].uni.offset_gint64
                , (int)vindex->ofs_tab[l_idx].seek_nr
                , (int)vindex->ofs_tab[l_idx].frame_length
                , (int)vindex->ofs_tab[l_idx].checksum
-               , vindex->ofs_tab[l_idx].timecode_dts
+               , (long long int)vindex->ofs_tab[l_idx].timecode_dts
                , l_dts_timecode_usable
                , (int)l_nloops
                );
@@ -2435,7 +2437,7 @@ p_seek_private(t_GVA_Handle *gvahand, gdouble pos, t_GVA_PosUnit pos_unit)
                      , (int)l_idx_target
                      , (int)vindex->ofs_tab[l_idx_target].checksum
                      , (int)l_checksum
-                     , handle->vid_pkt.dts
+                     , (long long int)handle->vid_pkt.dts
                      );
                    }
                    l_target_found = TRUE;
@@ -2678,8 +2680,6 @@ p_seek_native_timcode_based(t_GVA_Handle *gvahand, gint32 target_frame)
 {
   t_GVA_ffmpeg *handle;
   t_GVA_RetCode l_retcode;
-  t_GVA_RetCode l_rc_rd;
-  gint32   l_readsteps;
   gdouble  l_progress_step;
   gint32   l_pre_read_frames;
   gint     l_tries;
@@ -2788,7 +2788,6 @@ p_seek_native_timcode_based(t_GVA_Handle *gvahand, gint32 target_frame)
         /* seek variant based on global (not stream specific) pts timecode
          */
         int64_t  target_pts;
-        gdouble  secs;
 
         target_pts =
           av_rescale_q(l_seek_timecode, handle->vid_stream->time_base, AV_TIME_BASE_Q);
@@ -3021,8 +3020,8 @@ p_seek_native_timcode_based(t_GVA_Handle *gvahand, gint32 target_frame)
 
            }
 
-           l_debug_msg[0] = "\n";
-           l_debug_msg[1] = "\0";
+           l_debug_msg[0] = '\n';
+           l_debug_msg[1] = '\0';
 #ifdef GAP_DEBUG_FF_NATIVE_SEEK
            {
              g_snprintf(&l_debug_msg[0], sizeof(l_debug_msg)
@@ -3147,11 +3146,11 @@ p_seek_native_timcode_based(t_GVA_Handle *gvahand, gint32 target_frame)
                {
                  printf("%s**   Timecode OVERFLOW: curr: %lld oflow:%lld  prev:%lld pprev:%lld 
(wanted:%lld)\n"
                   , l_debug_msg
-                  , l_curr_timecode
-                  , l_overflow_timecode
-                  , l_prev_timecode
-                  , l_pprev_timecode
-                  , l_wanted_timecode
+                  , (long long int)l_curr_timecode
+                  , (long long int)l_overflow_timecode
+                  , (long long int)l_prev_timecode
+                  , (long long int)l_pprev_timecode
+                  , (long long int)l_wanted_timecode
                   );
                }
                l_retcode = GVA_RET_ERROR;
@@ -3224,7 +3223,13 @@ p_wrapper_ffmpeg_seek_audio(t_GVA_Handle *gvahand, gdouble pos, t_GVA_PosUnit po
   }
 
 
-  if(gap_debug) printf("p_wrapper_ffmpeg_seek_audio: l_sample_pos:%d\n", (int)l_sample_pos);
+  if(gap_debug)
+  {
+    printf("p_wrapper_ffmpeg_seek_audio: handle:%ld l_sample_pos:%d\n"
+        , (long)handle
+        , (int)l_sample_pos
+        );
+  }
 
   gvahand->current_sample = (gint32)l_sample_pos;
   return(GVA_RET_OK);
@@ -3718,12 +3723,12 @@ p_debug_codec_list(void)
      printf("name: %s\n", codec->name);
      printf("type: %d\n", codec->type);
      printf("id: %d\n",   codec->id);
-     printf("priv_data_size: %d\n",   codec->priv_data_size);
-     printf("capabilities: %d\n",   codec->capabilities);
-     printf("init fptr: %d\n",   (int)codec->init);
-     printf("encode fptr: %d\n",   (int)codec->encode);
-     printf("close fptr: %d\n",   (int)codec->close);
-     printf("decode fptr: %d\n",   (int)codec->decode);
+     printf("priv_data_size: %d\n",  codec->priv_data_size);
+     printf("capabilities: %d\n",    codec->capabilities);
+     printf("init fptr: %ld\n",     (long)codec->init);
+     printf("encode fptr: %ld\n",   (long)codec->encode);
+     printf("close fptr: %ld\n",    (long)codec->close);
+     printf("decode fptr: %ld\n",   (long)codec->decode);
   }
 }
 
@@ -3772,7 +3777,10 @@ p_ff_open_input(char *filename, t_GVA_Handle *gvahand, t_GVA_ffmpeg*  handle, gb
   int rfps, rfps_base;
   int thread_count;
   
-  if(gap_debug) printf("p_ff_open_input: START  vid_open:%d\n", (int)vid_open);
+  if(gap_debug)
+  {
+    printf("p_ff_open_input: START  vid_open:%d\n", (int)vid_open);
+  }
 
   thread_count = 4;
   
@@ -3789,7 +3797,10 @@ p_ff_open_input(char *filename, t_GVA_Handle *gvahand, t_GVA_ffmpeg*  handle, gb
   err = av_open_input_file(&ic, filename, NULL, 0, NULL);
   if (err < 0)
   {
-     if(gap_debug) printf("p_ff_open_input: av_open_input_file FAILED: %d\n", (int)err);
+     if(gap_debug)
+     {
+       printf("p_ff_open_input: av_open_input_file FAILED: %d\n", (int)err);
+     }
      return(FALSE);
   }
 
@@ -3797,12 +3808,12 @@ p_ff_open_input(char *filename, t_GVA_Handle *gvahand, t_GVA_ffmpeg*  handle, gb
 
   if(gap_debug)
   {
-    printf("ic: iformat: %d\n", (int)iformat);
+    printf("ic: iformat: %ld\n", (long)iformat);
     if(iformat)
     {
       printf("iformat name: %s\n", iformat->name);
       printf("iformat long_name: %s\n", iformat->long_name);
-      printf("iformat FPTR read_seek: %d\n", (int)iformat->read_seek);
+      printf("iformat FPTR read_seek: %ld\n", (long)iformat->read_seek);
     }
   }
 
@@ -3992,8 +4003,16 @@ p_ff_open_input(char *filename, t_GVA_Handle *gvahand, t_GVA_ffmpeg*  handle, gb
 
     if(gap_debug)
     {
-      if(handle->vid_codec_context) printf("(2) CodecPointer  AVCodecContext->codec : %d\n", 
(int)handle->vid_codec_context->codec);
-      if(handle->vid_codec_context->codec) printf("(2) Codec FunctionPointer  AVCodecContext->codec->decode 
: %d\n", (int)handle->vid_codec_context->codec->decode);
+      if(handle->vid_codec_context)
+      {
+        printf("(2) CodecPointer  AVCodecContext->codec : %ld\n"
+             , (long)handle->vid_codec_context->codec);
+      }
+      if(handle->vid_codec_context->codec)
+      {
+        printf("(2) Codec FunctionPointer  AVCodecContext->codec->decode : %ld\n"
+             , (long)handle->vid_codec_context->codec->decode);
+      }
     }
   }
 
@@ -4025,8 +4044,16 @@ p_ff_open_input(char *filename, t_GVA_Handle *gvahand, t_GVA_ffmpeg*  handle, gb
 
     if(gap_debug)
     {
-      if(handle->aud_codec_context) printf("(3) CodecPointer  AVCodecContext->codec : %d\n", 
(int)handle->aud_codec_context->codec);
-      if(handle->aud_codec_context->codec) printf("(3) Codec FunctionPointer  AVCodecContext->codec->decode 
: %d\n", (int)handle->aud_codec_context->codec->decode);
+      if(handle->aud_codec_context)
+      {
+        printf("(3) CodecPointer  AVCodecContext->codec : %ld\n"
+            , (long)handle->aud_codec_context->codec);
+      }
+      if(handle->aud_codec_context->codec)
+      {
+        printf("(3) Codec FunctionPointer  AVCodecContext->codec->decode : %ld\n"
+            , (long)handle->aud_codec_context->codec->decode);
+      }
     }
   }
 
@@ -4035,13 +4062,21 @@ p_ff_open_input(char *filename, t_GVA_Handle *gvahand, t_GVA_ffmpeg*  handle, gb
   {
     handle->vid_input_context = ic;
 
-    if(gap_debug) printf("p_ff_open_input: END  vid_input_context:%d\n", (int)handle->vid_input_context);
+    if(gap_debug)
+    {
+      printf("p_ff_open_input: END  vid_input_context:%ld\n"
+          , (long)handle->vid_input_context);
+    }
   }
   else
   {
     handle->aud_input_context = ic;
 
-    if(gap_debug) printf("p_ff_open_input: END  aud_input_context:%d\n", (int)handle->aud_input_context);
+    if(gap_debug)
+    {
+      printf("p_ff_open_input: END  aud_input_context:%ld\n"
+          , (long)handle->aud_input_context);
+    }
   }
 
   return(TRUE);
@@ -4440,15 +4475,15 @@ p_pick_channel( t_GVA_ffmpeg *handle
 
   if(gap_debug)
   {
-    printf("p_pick_channel(1): sample_idx:%d ch:%d bytes_p_s:%d sam_read:%d peek_idx:%d prev_peek_ptr:%d  
this_peek_ptr:%d poke_ptr:%d\n"
+    printf("p_pick_channel(1): sample_idx:%d ch:%d bytes_p_s:%d sam_read:%d peek_idx:%d prev_peek_ptr:%ld  
this_peek_ptr:%ld poke_ptr:%ld\n"
                         ,(int)sample_idx
                         ,(int)channel
                         ,(int)bytes_per_sample
                         ,(int)handle->samples_read
                         ,(int)peek_idx
-                        ,(int)prev_peek_ptr
-                        ,(int)this_peek_ptr
-                        ,(int)poke_ptr
+                        ,(long)prev_peek_ptr
+                        ,(long)this_peek_ptr
+                        ,(long)poke_ptr
                         );
     printf("p_pick_channel(2): samples:%d   prev_samples:%d this_samples:%d\n"
                         ,(int)samples
@@ -4489,12 +4524,12 @@ p_pick_channel( t_GVA_ffmpeg *handle
 
   if(gap_debug)
   {
-    printf("p_pick_channel END: l_samples_picked:%d l_samples:%d prev_peek_ptr:%d this_peek_ptr:%d 
poke_ptr%d\n"
+    printf("p_pick_channel END: l_samples_picked:%d l_samples:%d prev_peek_ptr:%ld this_peek_ptr:%ld 
poke_ptr%ld\n"
                       ,(int)l_samples_picked
                       ,(int)l_samples
-                      ,(int)prev_peek_ptr
-                      ,(int)this_peek_ptr
-                      ,(int)poke_ptr
+                      ,(long)prev_peek_ptr
+                      ,(long)this_peek_ptr
+                      ,(long)poke_ptr
                       );
   }
 
@@ -4547,10 +4582,10 @@ p_read_audio_packets( t_GVA_ffmpeg *handle, t_GVA_Handle *gvahand, gint32 max_sa
    {
      printf("p_read_audio_packets: before WHILE max_sample_pos: %d\n", (int)max_sample_pos);
      printf("p_read_audio_packets: before WHILE samples_read: %d\n", (int)handle->samples_read);
-     printf("samples_buffer[0]: %d samples_buffer[1]:%d output_samples_ptr:%d\n"
-         , (int)handle->samples_buffer[0]
-         , (int)handle->samples_buffer[1]
-         , (int)handle->output_samples_ptr
+     printf("samples_buffer[0]: %ld samples_buffer[1]:%ld output_samples_ptr:%ld\n"
+         , (long)handle->samples_buffer[0]
+         , (long)handle->samples_buffer[1]
+         , (long)handle->output_samples_ptr
         );
    }
 
@@ -4604,9 +4639,9 @@ p_read_audio_packets( t_GVA_ffmpeg *handle, t_GVA_Handle *gvahand, gint32 max_sa
 
       if (gap_debug)
       {
-        printf("using Packet stream_index:%d data:%d size:%d\n"
+        printf("using Packet stream_index:%d data:%ld size:%d\n"
           ,(int)handle->aud_pkt.stream_index
-          ,(int)handle->aud_pkt.data
+          ,(long)handle->aud_pkt.data
           ,(int)handle->aud_pkt.size
           );
       }
@@ -4654,8 +4689,8 @@ p_read_audio_packets( t_GVA_ffmpeg *handle, t_GVA_Handle *gvahand, gint32 max_sa
     }
     if(gap_debug)
     {
-       printf("before avcodec_decode_audio3: av_samples:%d data_size:%d\n"
-        , (int)handle->av_samples
+       printf("before avcodec_decode_audio3: av_samples:%ld data_size:%d\n"
+        , (long)handle->av_samples
         , (int)data_size
         );
     }
@@ -4745,7 +4780,8 @@ p_read_audio_packets( t_GVA_ffmpeg *handle, t_GVA_Handle *gvahand, gint32 max_sa
               l_sum++;
             }
           }
-          printf("\nSUM of NOT NULL bytes: %d output_samples_ptr:%d\n", (int)l_sum, 
(int)handle->output_samples_ptr);
+          printf("\nSUM of NOT NULL bytes: %d output_samples_ptr:%ld\n"
+               , (int)l_sum, (long)handle->output_samples_ptr);
        }
 
        /* check for the biggest uncompressed packet size */
@@ -4872,11 +4908,11 @@ p_vindex_add_url_offest(t_GVA_Handle *gvahand
     {
       printf("p_vindex_add_url_offest: ofs_tab[%d]: ofs64: %lld seek_nr:%d flen:%d chk:%d dts:%lld\n"
                        , (int)vindex->tabsize_used
-                       , vindex->ofs_tab[vindex->tabsize_used].uni.offset_gint64
+                       , (long long int)vindex->ofs_tab[vindex->tabsize_used].uni.offset_gint64
                        , (int)vindex->ofs_tab[vindex->tabsize_used].seek_nr
                        , (int)vindex->ofs_tab[vindex->tabsize_used].frame_length
                        , (int)vindex->ofs_tab[vindex->tabsize_used].checksum
-                       , vindex->ofs_tab[vindex->tabsize_used].timecode_dts
+                       , (long long int)vindex->ofs_tab[vindex->tabsize_used].timecode_dts
                        );
     }
     vindex->tabsize_used++;
@@ -4940,12 +4976,10 @@ p_init_timecode_log(t_GVA_Handle   *gvahand)
 {
   FILE *fp_timecode_log;
   gint32 gimprc_timecode_log;
-  gchar *timecode_logfile_name;
 
   gimprc_timecode_log
     = gap_base_get_gimprc_int_value("video-libavformat-timecodelog", 0, 0, 1);
   fp_timecode_log = NULL;
-  timecode_logfile_name = g_strdup("\0");
 
   if (gimprc_timecode_log != 0)
   {
@@ -4982,7 +5016,7 @@ p_init_timecode_log(t_GVA_Handle   *gvahand)
         , READSTEPS_PROBE_TIMECODE
         );
       fprintf(fp_timecode_log, "# timecode offset for frame1: %lld\n"
-        , master_handle->timecode_offset_frame1
+        , (long long int)master_handle->timecode_offset_frame1
         );
       fprintf(fp_timecode_log, "# count_timecode_steps:%d stepsizes summary:%d\n"
         , (int)master_handle->count_timecode_steps
@@ -5016,7 +5050,6 @@ p_timecode_check_and_log(FILE *fp_timecode_log, gint32 framenr, t_GVA_ffmpeg *ha
   static int64_t old_dts = 0;
   const char *remark_ptr;
   int64_t expected_dts;
-  int64_t diff_dts;
 
   expected_dts = p_frame_nr_to_timecode(master_handle, framenr);
 
@@ -5039,10 +5072,10 @@ p_timecode_check_and_log(FILE *fp_timecode_log, gint32 framenr, t_GVA_ffmpeg *ha
 
   fprintf(fp_timecode_log, "num:%06d; exp:%lld; dts:%lld; dts-olddts:%lld; exp-dts:%lld"
           , framenr
-          , expected_dts
-          , handle->vid_pkt.dts
-          , handle->vid_pkt.dts - old_dts
-          , expected_dts - handle->vid_pkt.dts
+          , (long long int)expected_dts
+          , (long long int)handle->vid_pkt.dts
+          , (long long int)handle->vid_pkt.dts - old_dts
+          , (long long int)expected_dts - handle->vid_pkt.dts
           );
 
   old_dts = handle->vid_pkt.dts;
@@ -5050,15 +5083,15 @@ p_timecode_check_and_log(FILE *fp_timecode_log, gint32 framenr, t_GVA_ffmpeg *ha
   if(handle->vid_pkt.pts != AV_NOPTS_VALUE)
   {
     fprintf(fp_timecode_log, "; pts:%lld; exp-pts:%lld; pts-dts:%lld"
-          , handle->vid_pkt.pts
-          , expected_dts - handle->vid_pkt.pts
-          , handle->vid_pkt.pts - handle->vid_pkt.dts
+          , (long long int)handle->vid_pkt.pts
+          , (long long int)expected_dts - handle->vid_pkt.pts
+          , (long long int)handle->vid_pkt.pts - handle->vid_pkt.dts
           );
 
     if (old_pts != AV_NOPTS_VALUE)
     {
       fprintf(fp_timecode_log, "; pts-oldpts:%lld"
-          , handle->vid_pkt.pts - old_pts
+          , (long long int)handle->vid_pkt.pts - old_pts
           );
     }
     old_pts = handle->vid_pkt.pts;
@@ -5129,7 +5162,6 @@ p_save_video_analyse_results(t_GVA_Handle *gvahand)
   GapValKeyList *keylist;
   t_GVA_ffmpeg *master_handle;
   FILE *fp_analyse;
-  gint  ii;
   char *analysefile_name;
 
   master_handle = (t_GVA_ffmpeg *)gvahand->decoder_handle;
@@ -5187,8 +5219,8 @@ p_save_video_analyse_results(t_GVA_Handle *gvahand)
              "#  (ffmpeg-libs-version:%s)\n"
            , master_handle->vid_stream->time_base.num
            , master_handle->vid_stream->time_base.den
-           , master_handle->vid_input_context->start_time
-           , master_handle->vid_input_context->duration
+           , (long long int)master_handle->vid_input_context->start_time
+           , (long long int)master_handle->vid_input_context->duration
            , p_timecode_to_frame_nr(master_handle, stt+duration3)
            , p_timecode_to_frame_nr(master_handle, master_handle->eof_timecode)
            , gap_base_get_gimprc_int_value("video-libavformat-seek-gopsize", DEFAULT_NAT_SEEK_GOPSIZE, 0, 
MAX_NAT_SEEK_GOPSIZE)
@@ -5364,9 +5396,9 @@ p_timecode_to_frame_nr(t_GVA_ffmpeg *handle, int64_t timecode)
   if(gap_debug)
   {
     printf("p_timecode_to_frame_nr: framenr:%lld  timecode:%lld offset_frame1:%lld\n"
-         , framenr
-         , timecode
-         , handle->timecode_offset_frame1
+         , (long long int)framenr
+         , (long long int)timecode
+         , (long long int)handle->timecode_offset_frame1
          );
   }
   return (framenr);
@@ -5421,9 +5453,9 @@ p_frame_nr_to_timecode(t_GVA_ffmpeg *handle, gint32 frame_nr)
   if(gap_debug)
   {
     printf("FRAMENR %ld  to TIMECODE:%lld  offset for frame1:%lld step[0]:%d steps:%d steps_sum:%d\n"
-      , frame_nr
-      , timecode
-      , handle->timecode_offset_frame1
+      , (long)frame_nr
+      , (long long int)timecode
+      , (long long int)handle->timecode_offset_frame1
       , (int)handle->timecode_steps[0]
       , (int)handle->count_timecode_steps
       , (int)handle->timecode_steps_sum
@@ -5604,9 +5636,9 @@ p_probe_timecode_offset(t_GVA_Handle *master_gvahand)
     if(gap_debug)
     {
        printf("GOT master_handle->timecode_offset_frame1:%lld copy_handle->vid_pkt.dts:%lld dts1:%lld\n"
-                  , master_handle->timecode_offset_frame1
-                  , copy_handle->vid_pkt.dts
-                  , copy_handle->pkt1_dts
+                  , (long long int)master_handle->timecode_offset_frame1
+                  , (long long int)copy_handle->vid_pkt.dts
+                  , (long long int)copy_handle->pkt1_dts
                   );
     }
 
@@ -5641,7 +5673,7 @@ p_probe_timecode_offset(t_GVA_Handle *master_gvahand)
       {
         printf("p_probe_timecode_offset: step: (%d) timecode offset: %lld, stepsize:%ld (avg_measured: %ld 
avg: %.3f)\n"
           , (int)l_readsteps
-          , master_handle->timecode_offset_frame1
+          , (long long int)master_handle->timecode_offset_frame1
           , (long)master_handle->timecode_steps[l_readsteps -1]
           , (long)master_handle->timecode_step_avg
           , (float)avg_fstepsize
@@ -5685,3 +5717,4 @@ p_probe_timecode_offset(t_GVA_Handle *master_gvahand)
 
 
 #endif  /* ENABLE_GVA_LIBAVFORMAT */
+
diff --git a/libgapvidapi/gap_vid_api_gimp.c b/libgapvidapi/gap_vid_api_gimp.c
index 07f6140..e8b518f 100644
--- a/libgapvidapi/gap_vid_api_gimp.c
+++ b/libgapvidapi/gap_vid_api_gimp.c
@@ -55,7 +55,10 @@ p_wrapper_gimp_check_sig(char *filename)
   l_image_id = gimp_file_load(GIMP_RUN_NONINTERACTIVE, filename, filename);
   if (l_image_id < 0)
   {
-     if(gap_debug) printf("p_wrapper_gimp_check_sig:%s: could not load file\n", filename);
+     if(gap_debug)
+     {
+       printf("p_wrapper_gimp_check_sig:%s: could not load file\n", filename);
+     }
      return(FALSE);
   }
 
@@ -63,7 +66,10 @@ p_wrapper_gimp_check_sig(char *filename)
    * in most cases the check_sig call is followed by open_read
    * where we need that image again
    */
-  if(global_gva_gimp_filename) g_free(global_gva_gimp_filename);
+  if(global_gva_gimp_filename)
+  {
+    g_free(global_gva_gimp_filename);
+  }
   global_gva_gimp_filename = g_strdup(filename);
   global_gva_gimp_image_id = l_image_id;
 
@@ -299,7 +305,15 @@ p_wrapper_gimp_seek_frame(t_GVA_Handle *gvahand, gdouble pos, t_GVA_PosUnit pos_
 
   if(l_frame_pos < gvahand->total_frames)
   {
-    if(gap_debug) printf("p_wrapper_gimp_seek_frame: SEEK OK: l_frame_pos: %d cur_seek:%d cur_frame:%d\n", 
(int)l_frame_pos, (int)gvahand->current_seek_nr, (int)gvahand->current_frame_nr);
+    if(gap_debug)
+    {
+      printf("p_wrapper_gimp_seek_frame: SEEK OK: handle:%ld l_frame_pos: %d cur_seek:%d cur_frame:%d\n"
+          , (long)handle
+          , (int)l_frame_pos
+          , (int)gvahand->current_seek_nr
+          , (int)gvahand->current_frame_nr
+          );
+    }
 
     gvahand->current_seek_nr = (gint32)l_frame_pos;
 
diff --git a/libgapvidapi/gap_vid_api_mp_util.c b/libgapvidapi/gap_vid_api_mp_util.c
index 0a1ccac..7056f0b 100644
--- a/libgapvidapi/gap_vid_api_mp_util.c
+++ b/libgapvidapi/gap_vid_api_mp_util.c
@@ -35,12 +35,12 @@ typedef struct GapMultiPocessorCopyOrDelaceData {  /* memcpd */
 /* ---------------------------
  * GVA_fcache_mutex_lock
  * ---------------------------
- * lock the fcache_mutex if present (e.g. is NOT NULL)
+ * lock the fcache_mutex if present (i.e. is NOT NULL)
  * Note: the fcache_mutex is NULL per default.
  *       In case an application wants to use the GVA api fcache in multithread environment,
  *       it must provide a mutex.
  *       example how to provide the mutex:
- *       (e.g gvahand->fcache_mutex = g_mutex_new() )
+ *       (i.e gvahand->fcache_mutex = g_mutex_new() )
  */
 void
 GVA_fcache_mutex_lock(t_GVA_Handle  *gvahand)
@@ -60,11 +60,11 @@ GVA_fcache_mutex_lock(t_GVA_Handle  *gvahand)
 /* ---------------------------
  * GVA_fcache_mutex_trylock
  * ---------------------------
- * lock the fcache_mutex if present (e.g. is NOT NULL)
+ * lock the fcache_mutex if present (i.e. is NOT NULL)
  * return immediate FALSE in case the mutex is locked by another thread
  * return TRUE in case the mutex was locked successfully (may sleep until other threads unlock the mutex)
  *        TRUE will be immediatly returned in case
- *        a) thread system is not initialized, e.g g_thread_init was not yet called
+ *        a) thread system is not initialized, i.e g_thread_init was not yet called
  *        b) in case the gvahand->fcache_mutex is NULL (which is default after opening a videohandle)
  */
 gboolean
@@ -84,7 +84,7 @@ GVA_fcache_mutex_trylock(t_GVA_Handle  *gvahand)
   {
     /* not really locked, because no mutex is available.
      * but in this case behave same as g_mutex_trylock
-     * when thread system is not initialized, e.g g_thread_init was not yet called
+     * when thread system is not initialized, i.e g_thread_init was not yet called
      */
     isSuccessful = TRUE;
   }
@@ -97,7 +97,7 @@ GVA_fcache_mutex_trylock(t_GVA_Handle  *gvahand)
 /* ---------------------------
  * GVA_fcache_mutex_unlock
  * ---------------------------
- * unlock the fcache_mutex if present (e.g. is NOT NULL)
+ * unlock the fcache_mutex if present (i.e. is NOT NULL)
  */
 void
 GVA_fcache_mutex_unlock(t_GVA_Handle  *gvahand)
@@ -300,6 +300,7 @@ GVA_copy_or_deinterlace_fcache_data_to_rgbBuffer(GVA_RgbPixelBuffer *rgbBuffer
   GAP_TIMM_GET_FUNCTION_ID(funcIdMainWait, "GVA_copy_or_deinterlace_fcache_data_to_rgbBuffer.main (Wait)");
 
   error = NULL;
+  ii = 0;
 
   if(gap_debug)
   {
diff --git a/libgapvidapi/gap_vid_api_mpeg3.c b/libgapvidapi/gap_vid_api_mpeg3.c
index 4f900e8..b289c40 100644
--- a/libgapvidapi/gap_vid_api_mpeg3.c
+++ b/libgapvidapi/gap_vid_api_mpeg3.c
@@ -306,8 +306,8 @@ p_wrapper_mpeg3_open_read(char *in_filename, t_GVA_Handle *gvahand)
 
     if(gap_debug)
     {
-      printf("GVA: libmpeg3 OPEN handle->main_handle:%d l_error_return:%d\n"
-            , (int)handle->main_handle
+      printf("GVA: libmpeg3 OPEN handle->main_handle:%ld l_error_return:%d\n"
+            , (long)handle->main_handle
             , (int)l_error_return
             );
     }
@@ -1166,7 +1166,13 @@ p_mpeg3_emulate_seek(mpeg3_t*  handle, gint32 seekto_frame, t_GVA_Handle *gvahan
        printf("p_mpeg3_emulate_seek(E): REOPEN ERROR filename: %s\n", gvahand->filename);
     }
 
-    if(gap_debug) printf("p_mpeg3_emulate_seek(E): after REOPEN seek_handle: %d  filename:%s\n", 
(int)seek_handle, gvahand->filename);
+    if(gap_debug)
+    {
+      printf("p_mpeg3_emulate_seek(E): after REOPEN seek_handle: %ld  filename:%s\n"
+          , (long)seek_handle
+          , gvahand->filename
+          );
+    }
 
   }
   else
@@ -1203,10 +1209,10 @@ p_mpeg3_emulate_seek(mpeg3_t*  handle, gint32 seekto_frame, t_GVA_Handle *gvahan
 
   if(gap_debug)
   {
-    printf("p_mpeg3_emulate_seek(E): current_seek_nr: %d    seekto_frame: %d  seek_handle:%d l_clean_reads: 
%d l_dirty_reads: %d\n"
+    printf("p_mpeg3_emulate_seek(E): current_seek_nr: %d    seekto_frame: %d  seek_handle:%ld l_clean_reads: 
%d l_dirty_reads: %d\n"
           , (int)gvahand->current_seek_nr
           , (int)seekto_frame
-          , (int)seek_handle
+          , (long)seek_handle
           , (int)l_clean_reads
           , (int)l_dirty_reads
           );
@@ -1457,4 +1463,3 @@ p_check_libmpeg3_toc_file(const char *filename)
 
 
 #endif   /* ENABLE_GVA_LIBMPEG3 */
-
diff --git a/libgapvidapi/gap_vid_api_mpeg3toc.c b/libgapvidapi/gap_vid_api_mpeg3toc.c
index 7e23517..65a7cd6 100644
--- a/libgapvidapi/gap_vid_api_mpeg3toc.c
+++ b/libgapvidapi/gap_vid_api_mpeg3toc.c
@@ -56,9 +56,9 @@ p_get_total_frames_from_toc(char *toc_filename, int vid_track)
 
   if(gap_debug)
   {
-      printf("GVA: p_get_total_frames_from_toc libmpeg3 OPEN %s handle->toc_handle:%d l_error_return:%d 
total_frames:%d\n"
+      printf("GVA: p_get_total_frames_from_toc libmpeg3 OPEN %s handle->toc_handle:%ld l_error_return:%d 
total_frames:%d\n"
             , toc_filename
-            , (int)toc_handle
+            , (long)toc_handle
             , (int)l_error_return
             , (int)total_frames
             );
@@ -79,7 +79,7 @@ GVA_create_libmpeg3_toc(int argc, char *argv[]
                 , t_GVA_Handle *gvahand
     , int *ret_total_frames)
 {
-        int i, j, l;
+        int i;
         char *src = 0, *dst = 0;
         int verbose = 0;
         gdouble progress_stepsize;
@@ -177,9 +177,9 @@ GVA_create_libmpeg3_toc(int argc, char *argv[]
                       gvahand->cancel_operation = 
(*gvahand->fptr_progress_callback)(gvahand->percentage_done, gvahand->progress_cb_user_data);
                       if(gap_debug)
                       {
-                        printf("MPEG3TOC: CANCEL(v):%d FPTR:%d\n"
+                        printf("MPEG3TOC: CANCEL(v):%d FPTR:%ld\n"
                               , (int)gvahand->cancel_operation
-                              , (int)gvahand->fptr_progress_callback
+                              , (long)gvahand->fptr_progress_callback
                               );
                       }
                       if(gvahand->cancel_operation)
@@ -200,4 +200,3 @@ GVA_create_libmpeg3_toc(int argc, char *argv[]
 
         return 0;
 }
-
diff --git a/libgapvidapi/gap_vid_api_vidindex.c b/libgapvidapi/gap_vid_api_vidindex.c
index b6e5c7e..f9379c8 100644
--- a/libgapvidapi/gap_vid_api_vidindex.c
+++ b/libgapvidapi/gap_vid_api_vidindex.c
@@ -321,7 +321,7 @@ p_debug_print_videoindex(t_GVA_Videoindex *vindex)
                , (int)vindex->ofs_tab[l_idx].seek_nr
                , (int)vindex->ofs_tab[l_idx].frame_length
                , (int)vindex->ofs_tab[l_idx].checksum
-               , vindex->ofs_tab[l_idx].timecode_dts
+               , (long long int)vindex->ofs_tab[l_idx].timecode_dts
                );
     }
   }
diff --git a/libgapvidutil/gap_gve_raw.c b/libgapvidutil/gap_gve_raw.c
index 2d92985..1d8d266 100644
--- a/libgapvidutil/gap_gve_raw.c
+++ b/libgapvidutil/gap_gve_raw.c
@@ -751,7 +751,7 @@ gap_gve_drawable_to_RgbBuffer(GimpDrawable *drawable, GapRgbPixelBuffer *rgbBuff
 //  * --------------------------------------------
 //  * this function runs in concurrent parallel worker threads in multiprocessor environment.
 //  * each one of the parallel running threads processes another portion of the drawable
-//  * (e.g. stripes starting at startCol and colWidth wide. of the processed drawable differs for each 
thread) 
+//  * (i.e. stripes starting at startCol and colWidth wide. of the processed drawable differs for each 
thread) 
 //  */
 // static void
 // p_drawable_to_RgbBuffer_WorkerThreadFunction(DrawableToRgbBufferProcessorData *drgb)
diff --git a/libgapvidutil/gap_gve_raw.h b/libgapvidutil/gap_gve_raw.h
index 86d7221..203326d 100644
--- a/libgapvidutil/gap_gve_raw.h
+++ b/libgapvidutil/gap_gve_raw.h
@@ -179,5 +179,12 @@ gap_gve_drawable_to_RgbBuffer(GimpDrawable *drawable, GapRgbPixelBuffer *rgbBuff
 void
 gap_gve_drawable_to_RgbBuffer_multithread(GimpDrawable *drawable, GapRgbPixelBuffer *rgbBuffer);
 
+
+
+guchar *
+gap_gve_raw_RGB_or_BGR_drawable_encode(GimpDrawable *drawable, gint32 *RAW_size, gboolean vflip
+                        ,guchar *app0_buffer, gint32 app0_length, gboolean convertToBGR);
+
+
 #endif
 
diff --git a/vid_common/gap_cme_callbacks.c b/vid_common/gap_cme_callbacks.c
index d98aa83..9fdcb5d 100644
--- a/vid_common/gap_cme_callbacks.c
+++ b/vid_common/gap_cme_callbacks.c
@@ -176,7 +176,6 @@ p_drop_chache_and_start_video_encoder(GapCmeGlobalParams *gpp)
 static void
 p_switch_gui_to_running_encoder_state(GapCmeGlobalParams *gpp)
 {
-  GtkWidget *label;
   GtkWidget *frame;
   GtkWidget *notebook;
   gint idx;
diff --git a/vid_common/gap_cme_gui.c b/vid_common/gap_cme_gui.c
index e6864f9..9bf62e7 100644
--- a/vid_common/gap_cme_gui.c
+++ b/vid_common/gap_cme_gui.c
@@ -190,7 +190,7 @@ gap_cme_gui_check_gui_thread_is_active(GapCmeGlobalParams *gpp)
       */
      if(gap_debug)
      {
-       gap_file_printf("MASTER: GUI thread %d is already active\n", (int)gpp->val.gui_proc_thread);
+       gap_file_printf("MASTER: GUI gui_proc_thread %ld is already active\n", 
(long)gpp->val.gui_proc_thread);
      }
      if(l_gap_message_open == FALSE)
      {
@@ -285,12 +285,12 @@ gap_cme_gui_thread_async_pdb_call(gpointer data)
 #ifdef GAP_USE_GTHREAD
   if(gap_debug) 
   {
-    gap_file_printf("THREAD: gap_cme_gui_thread_async_pdb_call &gpp: %d\n", (int)gpp);
+    gap_file_printf("THREAD: gap_cme_gui_thread_async_pdb_call &gpp: %ld\n", (long)gpp);
   }
 #else
   if(gap_debug) 
   {
-    gap_file_printf("non-thread call gap_cme_gui_thread_async_pdb_call &gpp: %d\n", (int)gpp);
+    gap_file_printf("non-thread call gap_cme_gui_thread_async_pdb_call &gpp: %ld\n", (long)gpp);
   }
 #endif
 
@@ -313,7 +313,7 @@ gap_cme_gui_thread_async_pdb_call(gpointer data)
 
     if(gap_debug)
     {
-      gap_file_printf("THREAD gui_proc err TERMINATING: %d\n", (int)gpp->val.gui_proc_thread);
+      gap_file_printf("THREAD gui_proc_thread err TERMINATING: %ld\n", (long)gpp->val.gui_proc_thread);
     }
 
     gpp->val.gui_proc_thread = NULL;
@@ -411,7 +411,7 @@ gap_cme_gui_thread_async_pdb_call(gpointer data)
 
   if(gap_debug)
   {
-    gap_file_printf("THREAD gui_proc TERMINATING: %d\n", (int)gpp->val.gui_proc_thread);
+    gap_file_printf("THREAD gui_proc_thread TERMINATING: %ld\n", (long)gpp->val.gui_proc_thread);
   }
 
   gpp->val.gui_proc_thread = NULL;
@@ -927,10 +927,10 @@ p_update_aud_info (GapCmeGlobalParams *gpp
 
   if(gap_debug)
   {
-    gap_file_printf("p_update_aud_info: START lbl_info:%d lbl_time:%d lbl_time0:%d\n"
-       ,(int)lbl_info
-       ,(int)lbl_time
-       ,(int)lbl_time0
+    gap_file_printf("p_update_aud_info: START lbl_info:%ld lbl_time:%ld lbl_time0:%ld\n"
+       ,(long)lbl_info
+       ,(long)lbl_time
+       ,(long)lbl_time0
        );
   }
 
@@ -1774,7 +1774,7 @@ p_thread_storyboard_file(gpointer data)
 
   if(gap_debug)
   {
-    gap_file_printf("THREAD: p_thread_storyboard_file &gpp: %d\n", (int)gpp);
+    gap_file_printf("THREAD: p_thread_storyboard_file &gpp: %ld\n", (long)gpp);
   }
 
   gstb = &global_stb;
@@ -1900,8 +1900,8 @@ p_thread_storyboard_file(gpointer data)
 
   if(gap_debug)
   {
-    gap_file_printf("THREAD storyboard TERMINATING: tid:%d first:%d last:%d input_mode:%d\n"
-       , (int)gpp->val.gui_proc_thread
+    gap_file_printf("THREAD storyboard TERMINATING: gui_proc_thread:%ld first:%d last:%d input_mode:%d\n"
+       , (long)gpp->val.gui_proc_thread
        , (int)gstb->first_frame_limit
        , (int)gstb->last_frame_nr
        , (int)gpp->val.input_mode
@@ -2060,18 +2060,16 @@ gboolean
 gap_cme_gui_check_encode_OK (GapCmeGlobalParams *gpp)
 {
   gchar       *l_msg;
-  long        samplerate, samplerate2;
+  long        samplerate;
   long        channels;
   long        bytes_per_sample;
-  long        bits, bits2;
+  long        bits;
   long        samples;
   gint         l_rc;
   gint32      tmsec;        /* audioplaytime in milli secs */
 
   samplerate = 0;
-  samplerate2 = 0;
   bits = 16;
-  bits2 = 16;
 
   if(gap_debug)
   {
@@ -2226,7 +2224,7 @@ gap_cme_gui_check_encode_OK (GapCmeGlobalParams *gpp)
 
   if(gap_debug)
   {
-    gap_file_printf("gap_cme_gui_check_encode_OK: End OK\n");
+    gap_file_printf("gap_cme_gui_check_encode_OK: End OK tmsec:%s\n", (int)tmsec);
   }
   return (TRUE); /* OK */
 }  /* end gap_cme_gui_check_encode_OK */
@@ -2642,7 +2640,7 @@ p_create_shell_window (GapCmeGlobalParams *gpp)
                          GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                          GTK_STOCK_OK,     GTK_RESPONSE_OK,
                          NULL);
-  gtk_window_set_type_hint (shell_window, GDK_WINDOW_TYPE_HINT_NORMAL);
+  gtk_window_set_type_hint (GTK_WINDOW(shell_window), GDK_WINDOW_TYPE_HINT_NORMAL);
   
   g_signal_connect (G_OBJECT (shell_window), "response",
                     G_CALLBACK (on_cme__response),
@@ -2847,11 +2845,6 @@ p_create_encoder_status_frame (GapCmeGlobalParams *gpp)
   GtkWidget *frame;
   GtkWidget *table;
   GtkWidget *label;
-  GtkObject *adj;
-  GtkWidget *spinbutton;
-  GtkWidget *combo;
-  GtkWidget *button;
-  GtkWidget *entry;
   gint       row;
 
   frame = gimp_frame_new (_("Video Encoder Status"));
@@ -4331,14 +4324,18 @@ gap_cme_encoder_worker_thread(gpointer data)
 
   if(gap_debug)
   {
-    gap_file_printf("THREAD: gap_cme_encoder_worker_thread &gpp: %d\n", (int)gpp);
+    gap_file_printf("THREAD: gap_cme_encoder_worker_thread &gpp: %ld\n"
+        , (long)gpp
+        );
   }
 
   gap_cme_gui_start_video_encoder(gpp);
 
   if(gap_debug)
   {
-    gap_file_printf("THREAD gap_cme_encoder_worker_thread TERMINATING: %d\n", (int)gpp->val.gui_proc_thread);
+    gap_file_printf("THREAD gap_cme_encoder_worker_thread TERMINATING: %ld\n"
+        , (long)gpp->val.gui_proc_thread
+        );
   }
 
   gpp->productive_encoder_thread = NULL;
diff --git a/vid_enc_avi/gap_enc_avi_gui.c b/vid_enc_avi/gap_enc_avi_gui.c
index 783d6b6..8dc703e 100644
--- a/vid_enc_avi/gap_enc_avi_gui.c
+++ b/vid_enc_avi/gap_enc_avi_gui.c
@@ -359,7 +359,10 @@ on_checkbutton_toggled (GtkToggleButton *togglebutton
 {
  GapGveAviGlobalParams *gpp;
 
- if(gap_debug) printf("CB: on_checkbutton_toggled: %d\n", (int)togglebutton);
+ if(gap_debug)
+ {
+   printf("CB: on_checkbutton_toggled: %ld\n", (long)togglebutton);
+ }
 
  if(val_ptr)
  {
@@ -462,7 +465,7 @@ p_create_shell_window (GapGveAviGlobalParams *gpp)
                          GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                          GTK_STOCK_OK,     GTK_RESPONSE_OK,
                          NULL);
-  gtk_window_set_type_hint (shell_window, GDK_WINDOW_TYPE_HINT_NORMAL);
+  gtk_window_set_type_hint (GTK_WINDOW(shell_window), GDK_WINDOW_TYPE_HINT_NORMAL);
 
   g_signal_connect (G_OBJECT (shell_window), "response",
                     G_CALLBACK (on_avi_response),
diff --git a/vid_enc_avi/gap_enc_avi_main.c b/vid_enc_avi/gap_enc_avi_main.c
index 5555f6a..817ede3 100644
--- a/vid_enc_avi/gap_enc_avi_main.c
+++ b/vid_enc_avi/gap_enc_avi_main.c
@@ -644,7 +644,7 @@ p_avi_encode(GapGveAviGlobalParams *gpp)
   long audio_margin = 8192; /* The audio chunk size */
 
 
-  char databuffer[300000]; /* For transferring audio data */
+  guchar databuffer[300000]; /* For transferring audio data */
   gint32   l_video_frame_chunk_size;
   gint32   l_video_frame_chunk_hdr_size;
   gboolean l_dont_recode_frames;
@@ -944,9 +944,9 @@ p_avi_encode(GapGveAviGlobalParams *gpp)
 
         if (gap_debug)
         {
-          printf("DEBUG: 1:1 copy of frame %d (fetch as chunk OK) chunk_ptr:%d  chunk_size:%d 
chunk_hdr_size:%d\n"
+          printf("DEBUG: 1:1 copy of frame %d (fetch as chunk OK) chunk_ptr:%ld  chunk_size:%d 
chunk_hdr_size:%d\n"
               , (int)l_cur_frame_nr
-              , (int)l_video_chunk_ptr
+              , (long)l_video_chunk_ptr
               , (int)l_video_frame_chunk_size
               , (int)l_video_frame_chunk_hdr_size
               );
@@ -954,7 +954,7 @@ p_avi_encode(GapGveAviGlobalParams *gpp)
         l_FRAME_size = l_video_frame_chunk_size - l_video_frame_chunk_hdr_size;
         buffer = l_video_chunk_ptr + l_video_frame_chunk_hdr_size;
 
-        AVI_write_frame(l_avifile, buffer, l_FRAME_size, TRUE /* all frames are keyframe for JPEG codec */);
+        AVI_write_frame(l_avifile, (char*)buffer, l_FRAME_size, TRUE /* all frames are keyframe for JPEG 
codec */);
 
       }
       else
@@ -1062,7 +1062,7 @@ p_avi_encode(GapGveAviGlobalParams *gpp)
                  , (int)l_keyframe
                  );
           }
-          AVI_write_frame(l_avifile, buffer, l_FRAME_size, l_keyframe);
+          AVI_write_frame(l_avifile, (char *)buffer, l_FRAME_size, l_keyframe);
           /* free the (un)compressed Frame data buffer */
           g_free(buffer);
         }
@@ -1099,7 +1099,7 @@ p_avi_encode(GapGveAviGlobalParams *gpp)
        * in case the audio input is shorter than video playtime write the rest
        * and stop writing audio for all further frame.
        * in case the audio input is longer than video playtime it is truncated.
-       * (e.g. the remaining audio is not written to the resulting video file).
+       * (i.e. the remaining audio is not written to the resulting video file).
        */
       if ((l_fp_inwav) && (wavsize > 0))
       {
@@ -1154,7 +1154,7 @@ p_avi_encode(GapGveAviGlobalParams *gpp)
           {
             printf("Now saving audio frame datasize:%d\n", (int)datasize);
           }
-          AVI_write_audio(l_avifile, databuffer, datasize);
+          AVI_write_audio(l_avifile, (char *)databuffer, datasize);
 
           if(gap_debug)
           {
diff --git a/vid_enc_ffmpeg/gap_enc_ffmpeg_callbacks.c b/vid_enc_ffmpeg/gap_enc_ffmpeg_callbacks.c
index c6ce924..748d3b5 100644
--- a/vid_enc_ffmpeg/gap_enc_ffmpeg_callbacks.c
+++ b/vid_enc_ffmpeg/gap_enc_ffmpeg_callbacks.c
@@ -141,7 +141,7 @@ on_ff_gint32_spinbutton_changed  (GtkWidget *widget,
 
   if(gap_debug)
   {
-    printf("CB: on_ff_gint32_spinbutton_changed widget: %d\n", (int)widget);
+    printf("CB: on_ff_gint32_spinbutton_changed widget: %ld\n", (long)widget);
   }
   if((dest_value_ptr == NULL) || (widget == NULL))
   { 
@@ -179,7 +179,7 @@ on_ff_gdouble_spinbutton_changed  (GtkWidget *widget,
 
   if(gap_debug)
   {
-    printf("CB: on_ff_gdouble_spinbutton_changed widget: %d\n", (int)widget);
+    printf("CB: on_ff_gdouble_spinbutton_changed widget: %ld\n", (long)widget);
   }
 
   if((dest_value_ptr == NULL) || (widget == NULL))
@@ -264,7 +264,7 @@ gap_ffcb_set_widget_sensitivity  (GapGveFFMpegGlobalParams *gpp)
       
   if(gpp->main_notebook != NULL) 
   {
-    gtk_notebook_set_show_tabs(gpp->main_notebook, l_sensitive);
+    gtk_notebook_set_show_tabs(GTK_NOTEBOOK(gpp->main_notebook), l_sensitive);
   }
  
 
@@ -281,9 +281,11 @@ on_ff_gint32_checkbutton_toggled  (GtkToggleButton *checkbutton,
                                    gint32          *dest_value_ptr)
 {
   GapGveFFMpegGlobalParams *gpp;
-  gboolean l_sensitive;
 
-  if(gap_debug) printf("CB: on_ff_gdouble_spinbutton_changed widget: %d\n", (int)checkbutton);
+  if(gap_debug) 
+  {
+    printf("CB: on_ff_gdouble_spinbutton_changed widget: %ld\n", (long)checkbutton);
+  }
 
 
   if((dest_value_ptr == NULL) || (checkbutton == NULL))
@@ -365,7 +367,14 @@ on_ff_fileformat_combo  (GtkWidget     *widget,
     /* get the internal string assotiated with the index value */
     name = gap_get_combo_string_by_idx(string_combo_elem_list, value);
 
-    if(gap_debug) printf("FMT listroot: %d  name: %s  index:%d\n", (int)string_combo_elem_list, name, 
(int)value);
+    if(gap_debug)
+    {
+       printf("FMT listroot: %ld  name: %s  index:%d\n"
+           , (long)string_combo_elem_list
+           , name
+           , (int)value
+           );
+    }
 
   }
 
@@ -406,7 +415,14 @@ on_ff_vid_codec_combo  (GtkWidget     *widget,
     /* get the internal string assotiated with the index value */
     name = gap_get_combo_string_by_idx(string_combo_elem_list, value);
 
-    if(gap_debug) printf("VCO listroot: %d  name: %s  index:%d\n", (int)string_combo_elem_list, name, 
(int)value);
+    if(gap_debug)
+    {
+      printf("VCO listroot: %ld  name: %s  index:%d\n"
+          , (long)string_combo_elem_list
+          , name
+          , (int)value
+          );
+    }
   }
   
   if(name)
@@ -442,7 +458,14 @@ on_ff_aud_codec_combo  (GtkWidget     *widget,
     /* get the internal string assotiated with the index value */
     name = gap_get_combo_string_by_idx(string_combo_elem_list, value);
 
-    if(gap_debug) printf("ACO listroot: %d  name: %s  index:%d\n", (int)string_combo_elem_list, name, 
(int)value);
+    if(gap_debug)
+    {
+      printf("ACO listroot: %ld  name: %s  index:%d\n"
+          , (long)string_combo_elem_list
+          , name
+          , (int)value
+          );
+    }
   }
 
   if(name)
@@ -512,8 +535,8 @@ on_ff_gint32_combo  (GtkWidget     *widget,
 
   if(gap_debug)
   { 
-    printf("CB: on_ff_gint32_combo index: val_ptr: %d %d\n"
-           , (int)val_ptr
+    printf("CB: on_ff_gint32_combo index: val_ptr: %ld %d\n"
+           , (long)val_ptr
            , (int)value
            );
   }
@@ -551,8 +574,6 @@ on_ff_presets_combo  (GtkWidget     *widget,
   {
     /* index 0 is used for OOPS do not use preset menu entry and is not a PRESET
      */
-    l_idx;
-
     if(gap_debug)
     {
       printf ("** encoder PRESET: %d\n", (int)l_idx);
diff --git a/vid_enc_ffmpeg/gap_enc_ffmpeg_gui.c b/vid_enc_ffmpeg/gap_enc_ffmpeg_gui.c
index a59fdff..17aee19 100644
--- a/vid_enc_ffmpeg/gap_enc_ffmpeg_gui.c
+++ b/vid_enc_ffmpeg/gap_enc_ffmpeg_gui.c
@@ -607,20 +607,20 @@ gap_get_combo_string_by_idx(gpointer string_combo_elem_list, gint idx)
   {
     if(string_combo_elem_list == (gpointer)glist_vid_codec)
     {
-      printf("gap_get_combo_string_by_idx: glist_vid_codec  ptr:%d\n"
-            ,(int)string_combo_elem_list
+      printf("gap_get_combo_string_by_idx: glist_vid_codec  ptr:%ld\n"
+            ,(long)string_combo_elem_list
             );
     }
     if(string_combo_elem_list == (gpointer)glist_aud_codec)
     {
-      printf("gap_get_combo_string_by_idx: glist_aud_codec  ptr:%d\n"
-            ,(int)string_combo_elem_list
+      printf("gap_get_combo_string_by_idx: glist_aud_codec  ptr:%ld\n"
+            ,(long)string_combo_elem_list
             );
     }
     if(string_combo_elem_list == (gpointer)glist_fileformat)
     {
-      printf("gap_get_combo_string_by_idx: glist_fileformat  ptr:%d\n"
-            ,(int)string_combo_elem_list
+      printf("gap_get_combo_string_by_idx: glist_fileformat  ptr:%ld\n"
+            ,(long)string_combo_elem_list
             );
     }
   }
@@ -812,7 +812,7 @@ p_init_combo_vals(GapGveFFMpegGlobalParams *gpp)
 
   if(gap_debug)
   {
-    printf("p_init_combo_vals DONE\n");
+    printf("p_init_combo_vals DONE, %s\n", name);
   }
 
 }  /* end p_init_combo_vals */
@@ -1092,9 +1092,9 @@ p_init_entry_widgets(GapGveFFMpegGlobalParams *gpp)
 {
   if(gap_debug)
   {
-    printf("p_init_entry_widgets gpp:%d  adr of evl: %d\n"
-          , (int)gpp
-          , (int)(&gpp->evl)
+    printf("p_init_entry_widgets gpp:%ld  adr of evl: %ld\n"
+          , (long)gpp
+          , (long)(&gpp->evl)
           );
     printf("gpp->evl.passlogfile %s\n", gpp->evl.passlogfile);
   }
@@ -4007,7 +4007,7 @@ p_create_ffmpeg_dialog_shell (GapGveFFMpegGlobalParams *gpp)
                          GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                          GTK_STOCK_OK,     GTK_RESPONSE_OK,
                          NULL);
-  gtk_window_set_type_hint (shell_window, GDK_WINDOW_TYPE_HINT_NORMAL);
+  gtk_window_set_type_hint (GTK_WINDOW(shell_window), GDK_WINDOW_TYPE_HINT_NORMAL);
 
   g_signal_connect (G_OBJECT (shell_window), "response",
                     G_CALLBACK (on_ff_response),
diff --git a/vid_enc_ffmpeg/gap_enc_ffmpeg_main.c b/vid_enc_ffmpeg/gap_enc_ffmpeg_main.c
index 243a75b..d88d51c 100644
--- a/vid_enc_ffmpeg/gap_enc_ffmpeg_main.c
+++ b/vid_enc_ffmpeg/gap_enc_ffmpeg_main.c
@@ -138,7 +138,7 @@ typedef struct t_audio_work
   long audio_per_frame_x100;
   long frames_per_second_x100;
   gdouble frames_per_second_x100f;
-  char *databuffer; /* 300000 dyn. allocated bytes for transferring audio data */
+  guchar *databuffer; /* 300000 dyn. allocated bytes for transferring audio data */
 
   long  sample_rate;
   long  channels;
@@ -324,8 +324,8 @@ static void              p_process_audio_frame(t_ffmpeg_handle *ffh, t_awk_array
 static void              p_close_audio_input_files(t_awk_array *awp);
 static void              p_open_audio_input_files(t_awk_array *awp, GapGveFFMpegGlobalParams *gpp);
 
-static gint64            p_calculate_current_timecode(t_ffmpeg_handle *ffh);
-static gint64            p_calculate_timecode(t_ffmpeg_handle *ffh, int frameNr);
+//static gint64            p_calculate_current_timecode(t_ffmpeg_handle *ffh);
+//static gint64            p_calculate_timecode(t_ffmpeg_handle *ffh, int frameNr);
 static void              p_set_timebase_from_framerate(AVRational *time_base, gdouble framerate);
 
 static void              p_ffmpeg_open_init(t_ffmpeg_handle *ffh, GapGveFFMpegGlobalParams *gpp);
@@ -367,7 +367,7 @@ static void           p_free_EncoderQueueResources(EncoderQueue     *eque);
 static void   p_fillQueueElem(EncoderQueue *eque, GapStoryFetchResult *gapStoryFetchResult, gboolean 
force_keyframe, gint vid_track);
 static void   p_encodeCurrentQueueElem(EncoderQueue *eque);
 static void   p_encoderWorkerThreadFunction (EncoderQueue *eque);
-static int    p_ffmpeg_write_frame_and_audio_multithread(EncoderQueue *eque, GapStoryFetchResult 
*gapStoryFetchResult, gboolean force_keyframe, gint vid_track);
+static void   p_ffmpeg_write_frame_and_audio_multithread(EncoderQueue *eque, GapStoryFetchResult 
*gapStoryFetchResult, gboolean force_keyframe, gint vid_track);
 
 
 
@@ -783,12 +783,12 @@ run (const gchar      *name,
 
 }       /* end run */
 
-static guint64
-p_timespecDiff(GTimeVal *startTimePtr, GTimeVal *endTimePtr)
-{
-  return ((endTimePtr->tv_sec * G_USEC_PER_SEC) + endTimePtr->tv_usec) -
-           ((startTimePtr->tv_sec * G_USEC_PER_SEC) + startTimePtr->tv_usec);
-}
+// static guint64
+// p_timespecDiff(GTimeVal *startTimePtr, GTimeVal *endTimePtr)
+// {
+//   return ((endTimePtr->tv_sec * G_USEC_PER_SEC) + endTimePtr->tv_usec) -
+//            ((startTimePtr->tv_sec * G_USEC_PER_SEC) + startTimePtr->tv_usec);
+// }
 
 static int
 p_base_get_thread_id_as_int()
@@ -811,13 +811,13 @@ p_debug_print_dump_AVCodecContext(AVCodecContext *codecContext)
 {
   printf("AVCodecContext Settings START\n");
 
-  printf("(av_class (ptr AVClass*)      %d)\n", (int)    codecContext->av_class);
+  printf("(av_class (ptr AVClass*)      %ld)\n",(long)   codecContext->av_class);
   printf("(bit_rate                     %d)\n", (int)    codecContext->bit_rate);
   printf("(bit_rate_tolerance           %d)\n", (int)    codecContext->bit_rate_tolerance);
   printf("(flags                        %d)\n", (int)    codecContext->flags);
   printf("(sub_id                       %d)\n", (int)    codecContext->sub_id);
   printf("(me_method                    %d)\n", (int)    codecContext->me_method);
-  printf("(extradata (ptr uint8)        %d)\n", (int)    codecContext->extradata);
+  printf("(extradata (ptr uint8)        %ld)\n",(long)   codecContext->extradata);
   printf("(extradata_size               %d)\n", (int)    codecContext->extradata_size);
   printf("(time_base.num                %d)\n", (int)    codecContext->time_base.num);
   printf("(time_base.den                %d)\n", (int)    codecContext->time_base.den);
@@ -844,10 +844,10 @@ p_debug_print_dump_AVCodecContext(AVCodecContext *codecContext)
   printf("(rc_strategy  (OBSOLETE)      %d)\n", (int)    codecContext->rc_strategy);
   printf("(b_frame_strategy             %d)\n", (int)    codecContext->b_frame_strategy);
   printf("(hurry_up                     %d)\n", (int)    codecContext->hurry_up);
-  printf("(codec (AVCodec *)            %d)\n", (int)    codecContext->codec);
-  printf("(priv_data (void *)           %d)\n", (int)    codecContext->priv_data);
+  printf("(codec (AVCodec *)            %ld)\n",(long)   codecContext->codec);
+  printf("(priv_data (void *)           %ld)\n",(long)   codecContext->priv_data);
   printf("(rtp_payload_size             %d)\n", (int)    codecContext->rtp_payload_size);
-  printf("(rtp_callback (fptr)          %d)\n", (int)    codecContext->rtp_callback);
+  printf("(rtp_callback (fptr)          %ld)\n",(long)   codecContext->rtp_callback);
   printf("(mv_bits                      %d)\n", (int)    codecContext->mv_bits);
   printf("(header_bits                  %d)\n", (int)    codecContext->header_bits);
   printf("(i_tex_bits                   %d)\n", (int)    codecContext->i_tex_bits);
@@ -868,20 +868,20 @@ p_debug_print_dump_AVCodecContext(AVCodecContext *codecContext)
   printf("(strict_std_compliance        %d)\n", (int)    codecContext->strict_std_compliance);
   printf("(b_quant_offset               %f)\n", (float)  codecContext->b_quant_offset);
   printf("(error_recognition            %d)\n", (int)    codecContext->error_recognition);
-  printf("(get_buffer  (fptr)           %d)\n", (int)    codecContext->get_buffer);
-  printf("(release_buffer (fptr)        %d)\n", (int)    codecContext->release_buffer);
+  printf("(get_buffer  (fptr)           %ld)\n",(long)   codecContext->get_buffer);
+  printf("(release_buffer (fptr)        %ld)\n",(long)   codecContext->release_buffer);
   printf("(has_b_frames                 %d)\n", (int)    codecContext->has_b_frames);
   printf("(block_align                  %d)\n", (int)    codecContext->block_align);
   printf("(parse_only                   %d)\n", (int)    codecContext->parse_only);
   printf("(mpeg_quant                   %d)\n", (int)    codecContext->mpeg_quant);
-  printf("(stats_out (char*)            %d)\n", (int)    codecContext->stats_out);
-  printf("(stats_in (char*)             %d)\n", (int)    codecContext->stats_in);
+  printf("(stats_out (char*)            %ld)\n",(long)   codecContext->stats_out);
+  printf("(stats_in (char*)             %ld)\n",(long)   codecContext->stats_in);
   printf("(rc_qsquish                   %f)\n", (float)  codecContext->rc_qsquish);
   printf("(rc_qmod_amp                  %f)\n", (float)  codecContext->rc_qmod_amp);
   printf("(rc_qmod_freq                 %d)\n", (int)    codecContext->rc_qmod_freq);
-  printf("(rc_override (RcOverride*)    %d)\n", (int)    codecContext->rc_override);
+  printf("(rc_override (RcOverride*)    %ld)\n",(long)   codecContext->rc_override);
   printf("(rc_override_count            %d)\n", (int)    codecContext->rc_override_count);
-  printf("(rc_eq (char *)               %d)\n", (int)    codecContext->rc_eq);
+  printf("(rc_eq (char *)               %ld)\n",(long)   codecContext->rc_eq);
   printf("(rc_max_rate                  %d)\n", (int)    codecContext->rc_max_rate);
   printf("(rc_min_rate                  %d)\n", (int)    codecContext->rc_min_rate);
   printf("(rc_buffer_size               %d)\n", (int)    codecContext->rc_buffer_size);
@@ -897,20 +897,20 @@ p_debug_print_dump_AVCodecContext(AVCodecContext *codecContext)
   printf("(dark_masking                 %f)\n", (float)  codecContext->dark_masking);
   printf("(idct_algo                    %d)\n", (int)    codecContext->idct_algo);
   printf("(slice_count                  %d)\n", (int)    codecContext->slice_count);
-  printf("(slice_offset (int *)         %d)\n", (int)    codecContext->slice_offset);
+  printf("(slice_offset (int *)         %ld)\n",(long)   codecContext->slice_offset);
   printf("(error_concealment            %d)\n", (int)    codecContext->error_concealment);
   printf("(dsp_mask                     %d)\n", (int)    codecContext->dsp_mask);
   printf("(bits_per_coded_sample        %d)\n", (int)    codecContext->bits_per_coded_sample);
   printf("(prediction_method            %d)\n", (int)    codecContext->prediction_method);
   printf("(sample_aspect_ratio.num      %d)\n", (int)    codecContext->sample_aspect_ratio.num);
   printf("(sample_aspect_ratio.den      %d)\n", (int)    codecContext->sample_aspect_ratio.den);
-  printf("(coded_frame (AVFrame*)       %d)\n", (int)    codecContext->coded_frame);
+  printf("(coded_frame (AVFrame*)       %ld)\n",(long)   codecContext->coded_frame);
   printf("(debug                        %d)\n", (int)    codecContext->debug);
   printf("(debug_mv                     %d)\n", (int)    codecContext->debug_mv);
-  printf("(error[0]                     %lld)\n",        codecContext->error[0]);
-  printf("(error[1]                     %lld)\n",        codecContext->error[1]);
-  printf("(error[2]                     %lld)\n",        codecContext->error[2]);
-  printf("(error[3]                     %lld)\n",        codecContext->error[3]);
+  printf("(error[0]                     %lld)\n",(long long int)codecContext->error[0]);
+  printf("(error[1]                     %lld)\n",(long long int)codecContext->error[1]);
+  printf("(error[2]                     %lld)\n",(long long int)codecContext->error[2]);
+  printf("(error[3]                     %lld)\n",(long long int)codecContext->error[3]);
   printf("(mb_qmin                      %d)\n", (int)    codecContext->mb_qmin);
   printf("(mb_qmax                      %d)\n", (int)    codecContext->mb_qmax);
   printf("(me_cmp                       %d)\n", (int)    codecContext->me_cmp);
@@ -923,29 +923,29 @@ p_debug_print_dump_AVCodecContext(AVCodecContext *codecContext)
   printf("(me_pre_cmp                   %d)\n", (int)    codecContext->me_pre_cmp);
   printf("(pre_dia_size                 %d)\n", (int)    codecContext->pre_dia_size);
   printf("(me_subpel_quality            %d)\n", (int)    codecContext->me_subpel_quality);
-  printf("(get_format (fptr)            %d)\n", (int)    codecContext->get_format);
+  printf("(get_format (fptr)            %ld)\n",(long)   codecContext->get_format);
   printf("(dtg_active_format            %d)\n", (int)    codecContext->dtg_active_format);
   printf("(me_range                     %d)\n", (int)    codecContext->me_range);
   printf("(intra_quant_bias             %d)\n", (int)    codecContext->intra_quant_bias);
   printf("(inter_quant_bias             %d)\n", (int)    codecContext->inter_quant_bias);
   printf("(color_table_id               %d)\n", (int)    codecContext->color_table_id);
   printf("(internal_buffer_count        %d)\n", (int)    codecContext->internal_buffer_count);
-  printf("(internal_buffer (void*)      %d)\n", (int)    codecContext->internal_buffer);
+  printf("(internal_buffer (void*)      %ld)\n",(long)   codecContext->internal_buffer);
   printf("(global_quality               %d)\n", (int)    codecContext->global_quality);
   printf("(coder_type                   %d)\n", (int)    codecContext->coder_type);
   printf("(context_model                %d)\n", (int)    codecContext->context_model);
   printf("(slice_flags                  %d)\n", (int)    codecContext->slice_flags);
   printf("(xvmc_acceleration            %d)\n", (int)    codecContext->xvmc_acceleration);
   printf("(mb_decision                  %d)\n", (int)    codecContext->mb_decision);
-  printf("(intra_matrix (uint16_t*)     %d)\n", (int)    codecContext->intra_matrix);
-  printf("(inter_matrix (uint16_t*)     %d)\n", (int)    codecContext->inter_matrix);
+  printf("(intra_matrix (uint16_t*)     %ld)\n",(long)   codecContext->intra_matrix);
+  printf("(inter_matrix (uint16_t*)     %ld)\n",(long)   codecContext->inter_matrix);
   printf("(stream_codec_tag             %d)\n", (int)    codecContext->stream_codec_tag);
   printf("(scenechange_threshold        %d)\n", (int)    codecContext->scenechange_threshold);
   printf("(lmin                         %d)\n", (int)    codecContext->lmin);
   printf("(lmax                         %d)\n", (int)    codecContext->lmax);
-  printf("(palctrl (AVPaletteControl*)  %d)\n", (int)    codecContext->palctrl);
+  printf("(palctrl (AVPaletteControl*)  %ld)\n",(long)   codecContext->palctrl);
   printf("(noise_reduction              %d)\n", (int)    codecContext->noise_reduction);
-  printf("(reget_buffer (fptr)          %d)\n", (int)    codecContext->reget_buffer);
+  printf("(reget_buffer (fptr)          %ld)\n",(long)   codecContext->reget_buffer);
   printf("(rc_initial_buffer_occupancy  %d)\n", (int)    codecContext->rc_initial_buffer_occupancy);
   printf("(inter_threshold              %d)\n", (int)    codecContext->inter_threshold);
   printf("(flags2                       %d)\n", (int)    codecContext->flags2);
@@ -954,7 +954,7 @@ p_debug_print_dump_AVCodecContext(AVCodecContext *codecContext)
   printf("(quantizer_noise_shaping      %d)\n", (int)    codecContext->quantizer_noise_shaping);
   printf("(thread_count                 %d)\n", (int)    codecContext->thread_count);
   printf("(execute (fptr)               %d)\n", (int)    codecContext->execute);
-  printf("(thread_opaque (void*)        %d)\n", (int)    codecContext->thread_opaque);
+  printf("(thread_opaque (void*)        %ld)\n",(long)   codecContext->thread_opaque);
   printf("(me_threshold                 %d)\n", (int)    codecContext->me_threshold);
   printf("(mb_threshold                 %d)\n", (int)    codecContext->mb_threshold);
   printf("(intra_dc_precision           %d)\n", (int)    codecContext->intra_dc_precision);
@@ -1003,18 +1003,18 @@ p_debug_print_dump_AVCodecContext(AVCodecContext *codecContext)
   printf("(prediction_order_method      %d)\n", (int)    codecContext->prediction_order_method);
   printf("(min_partition_order          %d)\n", (int)    codecContext->min_partition_order);
   printf("(max_partition_order          %d)\n", (int)    codecContext->max_partition_order);
-  printf("(timecode_frame_start         %lld)\n",        codecContext->timecode_frame_start);
+  printf("(timecode_frame_start         %lld)\n",(long long int)codecContext->timecode_frame_start);
   printf("(drc_scale                    %f)\n", (float)  codecContext->drc_scale);
-  printf("(reordered_opaque             %lld)\n",        codecContext->reordered_opaque);
+  printf("(reordered_opaque             %lld)\n",(long long int)codecContext->reordered_opaque);
   printf("(bits_per_raw_sample          %d)\n", (int)    codecContext->bits_per_raw_sample);
-  printf("(channel_layout               %lld)\n",        codecContext->channel_layout);
-  printf("(request_channel_layout       %lld)\n",        codecContext->request_channel_layout);
+  printf("(channel_layout               %lld)\n",(long long int)codecContext->channel_layout);
+  printf("(request_channel_layout       %lld)\n",(long long int)codecContext->request_channel_layout);
   printf("(rc_max_available_vbv_use     %f)\n", (float)  codecContext->rc_max_available_vbv_use);
   printf("(rc_min_vbv_overflow_use      %f)\n", (float)  codecContext->rc_min_vbv_overflow_use);
 
 #ifndef GAP_USES_OLD_FFMPEG_0_5
 
-  printf("(hwaccel_context              %d)\n", (int)    codecContext->hwaccel_context);
+  printf("(hwaccel_context              %ld)\n",(long)   codecContext->hwaccel_context);
   printf("(color_primaries              %d)\n", (int)    codecContext->color_primaries);
   printf("(color_trc                    %d)\n", (int)    codecContext->color_trc);
   printf("(colorspace                   %d)\n", (int)    codecContext->colorspace);
@@ -1041,7 +1041,7 @@ p_debug_print_dump_AVCodecContext(AVCodecContext *codecContext)
   printf("(thread_type                  %d)\n", (int)    codecContext->thread_type);
   printf("(active_thread_type           %d)\n", (int)    codecContext->active_thread_type);
   printf("(thread_safe_callbacks        %d)\n", (int)    codecContext->thread_safe_callbacks);
-  printf("(vbv_delay                    %lld)\n",        codecContext->vbv_delay);
+  printf("(vbv_delay                    %lld)\n", (long long int)codecContext->vbv_delay);
   printf("(audio_service_type           %d)\n", (int)    codecContext->audio_service_type);
   /* enum AVSampleFormat request_sample_fmt */
   /* int64_t pts_correction_num_faulty_pts; */
@@ -1158,7 +1158,7 @@ p_initPresetFromPresetIndex(GapGveFFMpegValues *epp, gint presetId)
 
   if(gap_debug)
   {
-    printf("p_initPresetFromPresetIndex: name:%s title:%s bckTitle:%s size:%d\n"
+    printf("p_initPresetFromPresetIndex: name:%s title:%s bckTitle:%s size:%ld\n"
       ,epp->presetName
       ,epp->title
       ,eppBck->title
@@ -1970,38 +1970,38 @@ p_open_audio_input_files(t_awk_array *awp, GapGveFFMpegGlobalParams *gpp)
 
 }  /* end p_open_audio_input_files */
 
-/* -----------------------------
- * p_calculate_timecode
- * -----------------------------
- * returns the timecode for the specified frameNr
- */
-static gint64
-p_calculate_timecode(t_ffmpeg_handle *ffh, int frameNr)
-{
-  gdouble dblTimecode;
-  gint64  timecode64;
-
-  /*
-   * gdouble seconds;
-   * seconds = (ffh->encode_frame_nr  / gpp->val.framerate);
-   */
-
-  dblTimecode = frameNr * ffh->pts_stepsize_per_frame;
-  timecode64 = dblTimecode;
-
-  return (timecode64);
-}  /* end p_calculate_timecode */
-
-/* -----------------------------
- * p_calculate_current_timecode
- * -----------------------------
- * returns the timecode for the current frame
- */
-static gint64
-p_calculate_current_timecode(t_ffmpeg_handle *ffh)
-{
-  return (p_calculate_timecode(ffh, ffh->encode_frame_nr));
-}
+// /* -----------------------------
+//  * p_calculate_timecode
+//  * -----------------------------
+//  * returns the timecode for the specified frameNr
+//  */
+// static gint64
+// p_calculate_timecode(t_ffmpeg_handle *ffh, int frameNr)
+// {
+//   gdouble dblTimecode;
+//   gint64  timecode64;
+// 
+//   /*
+//    * gdouble seconds;
+//    * seconds = (ffh->encode_frame_nr  / gpp->val.framerate);
+//    */
+// 
+//   dblTimecode = frameNr * ffh->pts_stepsize_per_frame;
+//   timecode64 = dblTimecode;
+// 
+//   return (timecode64);
+// }  /* end p_calculate_timecode */
+//
+// /* -----------------------------
+//  * p_calculate_current_timecode
+//  * -----------------------------
+//  * returns the timecode for the current frame
+//  */
+// static gint64
+// p_calculate_current_timecode(t_ffmpeg_handle *ffh)
+// {
+//   return (p_calculate_timecode(ffh, ffh->encode_frame_nr));
+// }
 
 
 /* -----------------------------
@@ -2192,11 +2192,11 @@ p_init_video_codec(t_ffmpeg_handle *ffh
 
   if(gap_debug)
   {
-    printf("p_init_video_codec ffh->vst[%d].vid_stream: %d   ffh->output_context->streams[%d]: %d 
nb_streams:%d\n"
+    printf("p_init_video_codec ffh->vst[%d].vid_stream: %ld   ffh->output_context->streams[%d]: %ld 
nb_streams:%d\n"
       ,(int)ii
-      ,(int)ffh->vst[ii].vid_stream
+      ,(long)ffh->vst[ii].vid_stream
       ,(int)ii
-      ,(int)ffh->output_context->streams[ii]
+      ,(long)ffh->output_context->streams[ii]
       ,(int)ffh->output_context->nb_streams
       );
   }
@@ -2935,11 +2935,11 @@ p_ffmpeg_open(GapGveFFMpegGlobalParams *gpp
     printf("  long_name: %s\n", ffh->file_oformat->long_name);
     printf("  extensions: %s\n", ffh->file_oformat->extensions);
     printf("  priv_data_size: %d\n", (int)ffh->file_oformat->priv_data_size);
-    printf("  ID default audio_codec: %d\n", (int)ffh->file_oformat->audio_codec);
-    printf("  ID default video_codec: %d\n", (int)ffh->file_oformat->video_codec);
-    printf("  FPTR write_header: %d\n", (int)ffh->file_oformat->write_header);
-    printf("  FPTR write_packet: %d\n", (int)ffh->file_oformat->write_packet);
-    printf("  FPTR write_trailer: %d\n", (int)ffh->file_oformat->write_trailer);
+    printf("  ID default audio_codec: %ld\n", (long)ffh->file_oformat->audio_codec);
+    printf("  ID default video_codec: %ld\n", (long)ffh->file_oformat->video_codec);
+    printf("  FPTR write_header: %ld\n", (long)ffh->file_oformat->write_header);
+    printf("  FPTR write_packet: %ld\n", (long)ffh->file_oformat->write_packet);
+    printf("  FPTR write_trailer: %ld\n", (long)ffh->file_oformat->write_trailer);
     printf("  flags: %d\n", (int)ffh->file_oformat->flags);
     printf("\n");
   }
@@ -3142,7 +3142,7 @@ p_ffmpeg_write_frame_chunk(t_ffmpeg_handle *ffh, gint32 encoded_size, gint vid_t
 
      codec = ffh->vst[ii].vid_codec_context->codec;
 
-     printf("p_ffmpeg_write_frame_chunk: START codec: %d  track:%d\n", (int)codec, (int)vid_track);
+     printf("p_ffmpeg_write_frame_chunk: START codec: %ld  track:%d\n", (long)codec, (int)vid_track);
      printf("\n-------------------------\n");
      printf("name: %s\n", codec->name);
      printf("type: %d\n", codec->type);
@@ -3167,16 +3167,16 @@ p_ffmpeg_write_frame_chunk(t_ffmpeg_handle *ffh, gint32 encoded_size, gint vid_t
        *   find a faster way to fix PTS
        */
       {
-        AVFrame   *big_picture_yuv;
-        AVPicture *picture_yuv;
+        //AVFrame   *big_picture_yuv;
+        //AVPicture *picture_yuv;
         AVPicture *picture_codec;
 
         /* picture to feed the codec */
         picture_codec = (AVPicture *)ffh->vst[ii].big_picture_codec;
 
         /* source picture (YUV420) */
-        big_picture_yuv = avcodec_alloc_frame();
-        picture_yuv = (AVPicture *)big_picture_yuv;
+        //big_picture_yuv = avcodec_alloc_frame();
+        //picture_yuv = (AVPicture *)big_picture_yuv;
 
         /* Feed the encoder with a (black) dummy frame
          */
@@ -3202,7 +3202,7 @@ p_ffmpeg_write_frame_chunk(t_ffmpeg_handle *ffh, gint32 encoded_size, gint vid_t
                                ,ffh->vst[ii].video_dummy_buffer, ffh->vst[ii].video_dummy_buffer_size
                                ,ffh->vst[ii].big_picture_codec);
 
-        g_free(big_picture_yuv);
+        //g_free(big_picture_yuv);
       }
 
       if(encoded_dummy_size == 0)
@@ -3231,7 +3231,7 @@ p_ffmpeg_write_frame_chunk(t_ffmpeg_handle *ffh, gint32 encoded_size, gint vid_t
               , (int)chunk_frame_type
               , (int)ffh->vst[ii].vid_codec_context->coded_frame->coded_picture_number
               , (int)ffh->vst[ii].vid_codec_context->coded_frame->display_picture_number
-              , ffh->vst[ii].vid_codec_context->coded_frame->pts
+              , (long long int)ffh->vst[ii].vid_codec_context->coded_frame->pts
               );
       }
 
@@ -3416,9 +3416,9 @@ p_ffmpeg_encodeAndWriteVideoFrame(t_ffmpeg_handle *ffh, AVFrame *picture_codec
   {
     if(gap_debug)
     {
-      printf("p_ffmpeg_encodeAndWriteVideoFrame: TID:%d before avcodec_encode_video  picture_codec:%d\n"
+      printf("p_ffmpeg_encodeAndWriteVideoFrame: TID:%d before avcodec_encode_video  picture_codec:%ld\n"
          , p_base_get_thread_id_as_int()
-         ,(int)picture_codec
+         ,(long)picture_codec
          );
     }
 
@@ -3489,14 +3489,14 @@ p_ffmpeg_encodeAndWriteVideoFrame(t_ffmpeg_handle *ffh, AVFrame *picture_codec
              , p_base_get_thread_id_as_int()
              , (int)encoded_size
              , pkt.stream_index
-             , pkt.pts
-             , pkt.dts
-             , c->coded_frame->pts
+             , (long long int)pkt.pts
+             , (long long int)pkt.dts
+             , (long long int)c->coded_frame->pts
              , c->time_base.num
              , c->time_base.den
-             ,st->pts.num
-             ,st->pts.den
-             ,st->pts.val
+             ,(long long int)st->pts.num
+             ,(long long int)st->pts.den
+             ,(long long int)st->pts.val
              );
 
         }
@@ -3808,11 +3808,11 @@ p_debug_print_RingbufferStatus(EncoderQueue *eque)
   ii=0;
   for(eq_elem = eque->eq_root; eq_elem != NULL; eq_elem = eq_elem_next)
   {
-    g_string_append_printf(logString, "TID:%d EQ_ELEM[%d]: %d  EQ_ELEM->next:%d STATUS:%d encode_frame_nr:%d"
+    g_string_append_printf(logString, "TID:%d EQ_ELEM[%d]: %ld  EQ_ELEM->next:%ld STATUS:%d 
encode_frame_nr:%d"
           , (int)tid
           , (int)ii
-          , (int)eq_elem
-          , (int)eq_elem->next
+          , (long)eq_elem
+          , (long)eq_elem->next
           , (int)eq_elem->status
           , (int)eq_elem->encode_frame_nr
           );
@@ -3877,9 +3877,9 @@ p_waitUntilEncoderQueIsProcessed(EncoderQueue *eque)
   {
     if(gap_debug)
     {
-      printf("p_waitUntilEncoderQueIsProcessed: WAIT MainTID:%d until encoder thread finishes queue 
processing. eq_write_ptr:%d STATUS:%d retry:%d \n"
+      printf("p_waitUntilEncoderQueIsProcessed: WAIT MainTID:%d until encoder thread finishes queue 
processing. eq_write_ptr:%ld STATUS:%d retry:%d \n"
         , p_base_get_thread_id_as_int()
-        , (int)eque->eq_write_ptr
+        , (long)eque->eq_write_ptr
         , (int)eque->eq_write_ptr->status
         , (int)retryCount
         );
@@ -3890,9 +3890,9 @@ p_waitUntilEncoderQueIsProcessed(EncoderQueue *eque)
 
     if(gap_debug)
     {
-      printf("p_waitUntilEncoderQueIsProcessed: WAKE-UP MainTID:%d after encoder thread finished queue 
processing. eq_write_ptr:%d STATUS:%d retry:%d \n"
+      printf("p_waitUntilEncoderQueIsProcessed: WAKE-UP MainTID:%d after encoder thread finished queue 
processing. eq_write_ptr:%ld STATUS:%d retry:%d \n"
         , p_base_get_thread_id_as_int()
-        , (int)eque->eq_write_ptr
+        , (long)eque->eq_write_ptr
         , (int)eque->eq_write_ptr->status
         , (int)retryCount
         );
@@ -3923,7 +3923,6 @@ p_waitUntilEncoderQueIsProcessed(EncoderQueue *eque)
 static void
 p_free_EncoderQueueResources(EncoderQueue     *eque)
 {
-  t_ffmpeg_handle     *ffh;
   EncoderQueueElem    *eq_elem;
   EncoderQueueElem    *eq_elem_next;
   gint                 ii;
@@ -3954,24 +3953,24 @@ p_free_EncoderQueueResources(EncoderQueue     *eque)
     {
       if(gap_debug)
       {
-        printf("p_free_EncoderQueueResources: g_free big_picture[%d] of eq_elem:%d\n"
+        printf("p_free_EncoderQueueResources: g_free big_picture[%d] of eq_elem:%ld\n"
           ,(int)ii
-          ,(int)eq_elem
+          ,(long)eq_elem
           );
       }
       g_free(eq_elem->eq_big_picture_codec[ii]);
       if(gap_debug)
       {
-        printf("p_free_EncoderQueueResources: g_mutex_free of eq_elem:%d\n"
-          ,(int)eq_elem
+        printf("p_free_EncoderQueueResources: g_mutex_free of eq_elem:%ld\n"
+          ,(long)eq_elem
           );
       }
       g_mutex_free(eq_elem->elemMutex);
     }
     if(gap_debug)
     {
-      printf("p_free_EncoderQueueResources: g_free eq_elem:%d\n"
-        ,(int)eq_elem
+      printf("p_free_EncoderQueueResources: g_free eq_elem:%ld\n"
+        ,(long)eq_elem
         );
     }
     eq_elem_next = eq_elem->next;
@@ -4002,7 +4001,6 @@ p_fillQueueElem(EncoderQueue *eque, GapStoryFetchResult *gapStoryFetchResult, gb
 {
   EncoderQueueElem *eq_write_ptr;
   AVFrame *picture_codec;
-  GimpDrawable *drawable;
 
   eq_write_ptr = eque->eq_write_ptr;
   eq_write_ptr->encode_frame_nr = eque->ffh->encode_frame_nr;
@@ -4013,10 +4011,9 @@ p_fillQueueElem(EncoderQueue *eque, GapStoryFetchResult *gapStoryFetchResult, gb
   GAP_TIMM_START_RECORD(&eque->mainDrawableToRgb);
   if(gap_debug)
   {
-    printf("p_fillQueueElem: START drawable:%d eq_write_ptr:%d picture_codec:%d vid_track:%d 
encode_frame_nr:%d\n"
-      ,(int)drawable
-      ,(int)eq_write_ptr
-      ,(int)picture_codec
+    printf("p_fillQueueElem: START eq_write_ptr:%ld picture_codec:%ld vid_track:%d encode_frame_nr:%d\n"
+      ,(long)eq_write_ptr
+      ,(long)picture_codec
       ,(int)eq_write_ptr->vid_track
       ,(int)eq_write_ptr->encode_frame_nr
       );
@@ -4032,11 +4029,9 @@ p_fillQueueElem(EncoderQueue *eque, GapStoryFetchResult *gapStoryFetchResult, gb
                  );
     if(gap_debug)
     {
-      printf("p_fillQueueElem: DONE drawable:%d drawableId:%d eq_write_ptr:%d picture_codec:%d vid_track:%d 
encode_frame_nr:%d\n"
-        ,(int)drawable
-        ,(int)drawable->drawable_id
-        ,(int)eq_write_ptr
-        ,(int)picture_codec
+      printf("p_fillQueueElem: DONE eq_write_ptr:%ld picture_codec:%ld vid_track:%d encode_frame_nr:%d\n"
+        ,(long)eq_write_ptr
+        ,(long)picture_codec
         ,(int)eq_write_ptr->vid_track
         ,(int)eq_write_ptr->encode_frame_nr
         );
@@ -4067,12 +4062,12 @@ p_encodeCurrentQueueElem(EncoderQueue *eque)
 
   if(gap_debug)
   {
-    printf("p_encodeCurrentQueueElem: TID:%d START eq_read_ptr:%d STATUS:%d ffh:%d picture_codec:%d 
vid_track:%d encode_frame_nr:%d\n"
+    printf("p_encodeCurrentQueueElem: TID:%d START eq_read_ptr:%ld STATUS:%d ffh:%ld picture_codec:%ld 
vid_track:%d encode_frame_nr:%d\n"
       , p_base_get_thread_id_as_int()
-      ,(int)eq_read_ptr
+      ,(long)eq_read_ptr
       ,(int)eq_read_ptr->status
-      ,(int)eque->ffh
-      ,(int)picture_codec
+      ,(long)eque->ffh
+      ,(long)picture_codec
       ,(int)eq_read_ptr->vid_track
       ,(int)eq_read_ptr->encode_frame_nr
       );
@@ -4087,10 +4082,10 @@ p_encodeCurrentQueueElem(EncoderQueue *eque)
 
   if(gap_debug)
   {
-    printf("p_encodeCurrentQueueElem: TID:%d DONE eq_read_ptr:%d picture_codec:%d vid_track:%d 
encode_frame_nr:%d\n"
+    printf("p_encodeCurrentQueueElem: TID:%d DONE eq_read_ptr:%ld picture_codec:%ld vid_track:%d 
encode_frame_nr:%d\n"
       , p_base_get_thread_id_as_int()
-      ,(int)eq_read_ptr
-      ,(int)picture_codec
+      ,(long)eq_read_ptr
+      ,(long)picture_codec
       ,(int)eq_read_ptr->vid_track
       ,(int)eq_read_ptr->encode_frame_nr
       );
@@ -4129,11 +4124,14 @@ p_encoderWorkerThreadFunction (EncoderQueue *eque)
 {
   EncoderQueueElem     *nextElem;
   gint32                encoded_frame_nr;
+
+  encoded_frame_nr = -1;
+
   if(gap_debug)
   {
-    printf("p_encoderWorkerThreadFunction: TID:%d before elemMutex eq_read_ptr:%d\n"
+    printf("p_encoderWorkerThreadFunction: TID:%d before elemMutex eq_read_ptr:%ld\n"
           , p_base_get_thread_id_as_int()
-          , (int)eque->eq_read_ptr
+          , (long)eque->eq_read_ptr
           );
   }
   /* lock at element level */
@@ -4150,9 +4148,9 @@ p_encoderWorkerThreadFunction (EncoderQueue *eque)
   
   if(gap_debug)
   {
-    printf("p_encoderWorkerThreadFunction: TID:%d  after elemMutex lock eq_read_ptr:%d STATUS:%d 
encode_frame_nr:%d\n"
+    printf("p_encoderWorkerThreadFunction: TID:%d  after elemMutex lock eq_read_ptr:%ld STATUS:%d 
encode_frame_nr:%d\n"
           , p_base_get_thread_id_as_int()
-          , (int)eque->eq_read_ptr
+          , (long)eque->eq_read_ptr
           , (int)eque->eq_read_ptr->status
           , (int)eque->eq_read_ptr->encode_frame_nr
           );
@@ -4201,7 +4199,7 @@ ENCODER_LOOP:
 
     GAP_TIMM_START_RECORD(&eque->ethreadEncodeFrame);
 
-    /* Encode and write the current element (e.g. videoframe) at eq_read_ptr */
+    /* Encode and write the current element (i.e. videoframe) at eq_read_ptr */
     p_encodeCurrentQueueElem(eque);
 
     if(eque->ffh->countVideoFramesWritten > 0)
@@ -4213,7 +4211,7 @@ ENCODER_LOOP:
     GAP_TIMM_STOP_RECORD(&eque->ethreadEncodeFrame);
 
 
-    /* setting EQELEM_STATUS_FREE enables re-use (e.g. overwrite)
+    /* setting EQELEM_STATUS_FREE enables re-use (i.e. overwrite)
      * of this element's data buffers.
      */
     eque->eq_read_ptr->status = EQELEM_STATUS_FREE;
@@ -4298,9 +4296,9 @@ ENCODER_STOP:
 
   if(gap_debug)
   {
-    printf("p_encoderWorkerThreadFunction: TID:%d  DONE eq_read_ptr:%d encoded_frame_nr:%d\n"
+    printf("p_encoderWorkerThreadFunction: TID:%d  DONE eq_read_ptr:%ld encoded_frame_nr:%d\n"
           , p_base_get_thread_id_as_int()
-          , (int)eque->eq_read_ptr
+          , (long)eque->eq_read_ptr
           , encoded_frame_nr
           );
   }
@@ -4316,7 +4314,7 @@ ENCODER_STOP:
  * Passing NULL as gapStoryFetchResult is used to flush one frame from the codecs internal buffer
  * (typically required after the last frame has been already feed to the codec)
  */
-static int
+static void
 p_ffmpeg_write_frame_and_audio_multithread(EncoderQueue *eque
    , GapStoryFetchResult *gapStoryFetchResult, gboolean force_keyframe, gint vid_track)
 {
@@ -4355,8 +4353,8 @@ p_ffmpeg_write_frame_and_audio_multithread(EncoderQueue *eque
 
   if(gap_debug)
   {
-    printf("p_ffmpeg_write_frame_and_audio_multithread: before elemMutex lock eq_write_ptr:%d STATUS:%d 
retry:%d encode_frame_nr:%d\n"
-          , (int)eque->eq_write_ptr
+    printf("p_ffmpeg_write_frame_and_audio_multithread: before elemMutex lock eq_write_ptr:%ld STATUS:%d 
retry:%d encode_frame_nr:%d\n"
+          , (long)eque->eq_write_ptr
           , (int)eque->eq_write_ptr->status
           , (int)retryCount
           , (int)eque->ffh->encode_frame_nr
@@ -4376,8 +4374,8 @@ p_ffmpeg_write_frame_and_audio_multithread(EncoderQueue *eque
   
   if(gap_debug)
   {
-    printf("p_ffmpeg_write_frame_and_audio_multithread: after elemMutex lock eq_write_ptr:%d STATUS:%d 
retry:%d encode_frame_nr:%d\n"
-          , (int)eque->eq_write_ptr
+    printf("p_ffmpeg_write_frame_and_audio_multithread: after elemMutex lock eq_write_ptr:%ld STATUS:%d 
retry:%d encode_frame_nr:%d\n"
+          , (long)eque->eq_write_ptr
           , (int)eque->eq_write_ptr->status
           , (int)retryCount
           , (int)eque->ffh->encode_frame_nr
@@ -4402,8 +4400,8 @@ p_ffmpeg_write_frame_and_audio_multithread(EncoderQueue *eque
     {
       if(gap_debug)
       {
-        printf("p_ffmpeg_write_frame_and_audio_multithread: PUSH-1 (re)start worker thread eq_write_ptr:%d 
STATUS:%d retry:%d encode_frame_nr:%d\n"
-          , (int)eque->eq_write_ptr
+        printf("p_ffmpeg_write_frame_and_audio_multithread: PUSH-1 (re)start worker thread eq_write_ptr:%ld 
STATUS:%d retry:%d encode_frame_nr:%d\n"
+          , (long)eque->eq_write_ptr
           , (int)eque->eq_write_ptr->status
           , (int)retryCount
           , (int)eque->ffh->encode_frame_nr
@@ -4461,8 +4459,8 @@ p_ffmpeg_write_frame_and_audio_multithread(EncoderQueue *eque
 
   if(gap_debug)
   {
-    printf("p_ffmpeg_write_frame_and_audio_multithread: FILL-QUEUE eq_write_ptr:%d STATUS:%d retry:%d 
encode_frame_nr:%d\n"
-      , (int)eque->eq_write_ptr
+    printf("p_ffmpeg_write_frame_and_audio_multithread: FILL-QUEUE eq_write_ptr:%ld STATUS:%d retry:%d 
encode_frame_nr:%d\n"
+      , (long)eque->eq_write_ptr
       , (int)eque->eq_write_ptr->status
       , (int)retryCount
       , (int)eque->ffh->encode_frame_nr
@@ -4490,8 +4488,8 @@ p_ffmpeg_write_frame_and_audio_multithread(EncoderQueue *eque
       
       if(gap_debug)
       {
-        printf("p_ffmpeg_write_frame_and_audio_multithread: PUSH-2 (re)start worker thread eq_write_ptr:%d 
STATUS:%d retry:%d encode_frame_nr:%d\n"
-          , (int)eque->eq_write_ptr
+        printf("p_ffmpeg_write_frame_and_audio_multithread: PUSH-2 (re)start worker thread eq_write_ptr:%ld 
STATUS:%d retry:%d encode_frame_nr:%d\n"
+          , (long)eque->eq_write_ptr
           , (int)eque->eq_write_ptr->status
           , (int)retryCount
           , (int)eque->ffh->encode_frame_nr
@@ -4532,7 +4530,6 @@ p_ffmpeg_write_frame(t_ffmpeg_handle *ffh, GapStoryFetchResult *gapStoryFetchRes
   , gboolean force_keyframe, gint vid_track)
 {
   AVFrame *picture_codec;
-  int encoded_size;
   int ret;
   int ii;
 
@@ -4546,8 +4543,8 @@ p_ffmpeg_write_frame(t_ffmpeg_handle *ffh, GapStoryFetchResult *gapStoryFetchRes
      codec = ffh->vst[ii].vid_codec_context->codec;
 
      printf("\n-------------------------\n");
-     printf("p_ffmpeg_write_frame: START codec: %d track:%d countVideoFramesWritten:%d frame_nr:%d 
(validFrameNr:%d)\n"
-           , (int)codec
+     printf("p_ffmpeg_write_frame: START codec: %ld track:%d countVideoFramesWritten:%d frame_nr:%d 
(validFrameNr:%d)\n"
+           , (long)codec
            , (int)vid_track
            , (int)ffh->countVideoFramesWritten
            , (int)ffh->encode_frame_nr
@@ -4560,10 +4557,10 @@ p_ffmpeg_write_frame(t_ffmpeg_handle *ffh, GapStoryFetchResult *gapStoryFetchRes
        printf("id: %d\n",   codec->id);
        printf("priv_data_size: %d\n",   codec->priv_data_size);
        printf("capabilities: %d\n",   codec->capabilities);
-       printf("init fptr: %d\n",   (int)codec->init);
-       printf("encode fptr: %d\n",   (int)codec->encode);
-       printf("close fptr: %d\n",   (int)codec->close);
-       printf("decode fptr: %d\n",   (int)codec->decode);
+       printf("init fptr: %ld\n",   (long)codec->init);
+       printf("encode fptr: %ld\n",   (long)codec->encode);
+       printf("close fptr: %ld\n",   (long)codec->close);
+       printf("decode fptr: %ld\n",   (long)codec->decode);
     }
   }
 
@@ -4571,7 +4568,7 @@ p_ffmpeg_write_frame(t_ffmpeg_handle *ffh, GapStoryFetchResult *gapStoryFetchRes
   picture_codec = ffh->vst[ii].big_picture_codec;
 
   /* in case gapStoryFetchResult is NULL
-   * we feed the previous handled picture (e.g the last of the input)
+   * we feed the previous handled picture (i.e. the last of the input)
    * again and again to the codec
    * Note that this procedure typically is called with NULL  drawbale
    * until all frames in its internal buffer are writen to the output video.
@@ -4615,9 +4612,9 @@ p_ffmpeg_write_audioframe(t_ffmpeg_handle *ffh, guchar *audio_buf, int frame_byt
     if(gap_debug)
     {
       printf("p_ffmpeg_write_audioframe: START audo track ii=%d\n", (int)ii);
-      printf("ffh->ast[%d].audio_buffer: %d\n", (int)ii, (int)ffh->ast[ii].audio_buffer);
+      printf("ffh->ast[%d].audio_buffer: %ld\n", (int)ii, (long)ffh->ast[ii].audio_buffer);
       printf("ffh->ast[%d].audio_buffer_size: %d\n", (int)ii, ffh->ast[ii].audio_buffer_size);
-      printf("audio_buf: %d\n", (int)audio_buf);
+      printf("audio_buf: %ld\n", (long)audio_buf);
     }
     encoded_size = avcodec_encode_audio(ffh->ast[ii].aud_codec_context
                            ,ffh->ast[ii].audio_buffer, ffh->ast[ii].audio_buffer_size
@@ -4664,8 +4661,8 @@ p_ffmpeg_write_audioframe(t_ffmpeg_handle *ffh, guchar *audio_buf, int frame_byt
       {
         printf("before av_interleaved_write_frame audio  encoded_size:%d pkt.pts:%lld dts:%lld\n"
           , (int)encoded_size
-          , pkt.pts
-          , pkt.dts
+          , (long long int)pkt.pts
+          , (long long int)pkt.dts
           );
       }
 
@@ -5024,7 +5021,6 @@ p_ffmpeg_encode_pass(GapGveFFMpegGlobalParams *gpp, gint32 current_pass, GapGveM
   t_awk_array   l_awk_arr;
   t_awk_array   *awp;
   GapCodecNameElem    *l_vcodec_list;
-  const char          *l_env;
   GapStoryFetchResult  gapStoryFetchResultLocal;
   GapStoryFetchResult *gapStoryFetchResult;
 
@@ -5189,7 +5185,7 @@ p_ffmpeg_encode_pass(GapGveFFMpegGlobalParams *gpp, gint32 current_pass, GapGveM
   {
     gboolean l_force_keyframe;
     gint32   l_video_frame_chunk_size;
-    gint32   l_video_frame_chunk_hdr_size;
+    /* gint32   l_video_frame_chunk_hdr_size; */
 
     ffh->validEncodeFrameNr = ffh->encode_frame_nr;
 
@@ -5254,7 +5250,7 @@ p_ffmpeg_encode_pass(GapGveFFMpegGlobalParams *gpp, gint32 current_pass, GapGveM
           printf("DEBUG: 1:1 copy of frame %d\n", (int)l_master_frame_nr);
         }
         l_video_frame_chunk_size = gapStoryFetchResult->video_frame_chunk_size;
-        l_video_frame_chunk_hdr_size = gapStoryFetchResult->video_frame_chunk_hdr_size;
+        /* l_video_frame_chunk_hdr_size = gapStoryFetchResult->video_frame_chunk_hdr_size; */
 
         GAP_TIMM_START_FUNCTION(funcIdVidCopy11);
 
diff --git a/vid_enc_ffmpeg/gap_enc_ffmpeg_par.c b/vid_enc_ffmpeg/gap_enc_ffmpeg_par.c
index 1fc2d8a..43a96c4 100644
--- a/vid_enc_ffmpeg/gap_enc_ffmpeg_par.c
+++ b/vid_enc_ffmpeg/gap_enc_ffmpeg_par.c
@@ -442,7 +442,7 @@ gap_ffpar_get(const char *filename, GapGveFFMpegValues *epp)
 
   if(gap_debug)
   {
-    printf("gap_ffpar_get: params loaded: epp:%d\n", (int)epp);
+    printf("gap_ffpar_get: params loaded: epp:%ld\n", (long)epp);
     p_debug_printf_parameters(epp);
   }
 }  /* end gap_ffpar_get */
@@ -468,7 +468,7 @@ gap_ffpar_set(const char *filename, GapGveFFMpegValues *epp)
 
   if(gap_debug)
   {
-    printf("gap_ffpar_set: now saving parameters: epp:%d to file:%s\n", (int)epp, filename);
+    printf("gap_ffpar_set: now saving parameters: epp:%ld to file:%s\n", (long)epp, filename);
     p_debug_printf_parameters(epp);
   }
 
@@ -722,11 +722,11 @@ p_add_entry_sorted_by_name(GapGveFFMpegValues *eppStart, GapGveFFMpegValues *epp
      
      for(epp = eppRoot; epp != NULL; epp = epp->next)
      {
-       printf("[%d]:%s: addr:%d next:%d"
+       printf("[%d]:%s: addr:%ld next:%ld"
          , (int)ii
          , epp->presetName
-         ,(int)epp
-         ,(int)epp->next
+         ,(long)epp
+         ,(long)epp->next
          );
        if(epp == eppRoot)
        {
@@ -888,7 +888,7 @@ gap_ffpar_getPresetList()
 
    /* user specific directory   example: /home/hof/.gimp-2.6 
     * (preset names that are already present in previous processed directory
-    * will be overwritten. e.g. user specific variant is preferred)
+    * will be overwritten. i.e. user specific variant is preferred)
     */
    presetDir = g_build_filename(gimp_directory(), GAP_VIDEO_ENCODER_PRESET_DIR, NULL);
    p_add_presets_from_directory(eppPrev, presetDir);
diff --git a/vid_enc_rawframes/gap_enc_rawframes_main.c b/vid_enc_rawframes/gap_enc_rawframes_main.c
index 17d5252..6daf34f 100644
--- a/vid_enc_rawframes/gap_enc_rawframes_main.c
+++ b/vid_enc_rawframes/gap_enc_rawframes_main.c
@@ -633,7 +633,7 @@ gboolean
 p_save_chunk_as_frame(const char *filename,  unsigned char *video_chunk, gint32 video_frame_chunk_size, 
gint32 header_length)
 {
   FILE   *fp;
-  char   *dataPtr;
+  unsigned char   *dataPtr;
   gint32  dataSize;
 
   dataSize = video_frame_chunk_size - header_length;
@@ -863,9 +863,9 @@ p_rawframe_encode(GapGveRawGlobalParams *gpp)
         l_cnt_reused_frames++;
         if (gap_debug)
         {
-          printf("DEBUG: 1:1 copy of frame %d (fetch as chunk OK) chunk_ptr:%d  chunk_size:%d 
chunk_hdr_size:%d\n"
+          printf("DEBUG: 1:1 copy of frame %d (fetch as chunk OK) chunk_ptr:%ld  chunk_size:%d 
chunk_hdr_size:%d\n"
               , (int)l_cur_frame_nr
-              , (int)l_video_chunk_ptr
+              , (long)l_video_chunk_ptr
               , (int)l_video_frame_chunk_size
               , (int)l_video_frame_chunk_hdr_size
               );
diff --git a/vid_enc_single/gap_enc_singleframes_main.c b/vid_enc_single/gap_enc_singleframes_main.c
index b0f54c5..cb9b67e 100644
--- a/vid_enc_single/gap_enc_singleframes_main.c
+++ b/vid_enc_single/gap_enc_singleframes_main.c
@@ -798,12 +798,3 @@ p_singleframe_encode(GapGveSingleGlobalParams *gpp)
 }  /* end p_singleframe_encode */
 
 
-
-
-
-
-
-
-
-//////////////////////
-



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]