[SCM] pd-iemguts/master: New upstream version 0.2.1

umlaeute at users.alioth.debian.org umlaeute at users.alioth.debian.org
Fri Nov 11 11:14:04 UTC 2016


The following commit has been merged in the master branch:
commit 2d395c62f6959ac480624cbd372a8a7a2162424c
Author: IOhannes m zmölnig <zmoelnig at umlautQ.umlaeute.mur.at>
Date:   Fri Nov 11 11:43:24 2016 +0100

    New upstream version 0.2.1

diff --git a/.travis.yml b/.travis.yml
new file mode 100644
index 0000000..2cebe99
--- /dev/null
+++ b/.travis.yml
@@ -0,0 +1,29 @@
+language: c
+sudo: required
+dist: trusty
+
+env:
+  global:
+        - secure: "VtjMps4NzAMe2I3/CClJ6r8XJeXZ+4dtQR2EIul+IgPNhCexLA96Y9MLjXaE90+frOYZvuQUN/WXjqRrc5M3PgsaRnSRqlpqQSQX47AII/qoY8xf/mEJ2fn/QhF63XDRe+91cVFNG5MHUKLPDcl3QhiPBUmkN8eJtFDPrtXZiU+2zGs+sbyqB/E5BCvQAq1QCqSNbI/JUTQpcafbQf11rrzfsJBo9e/C/VK6rK+LB8Xch1ajiKPlud/VL8RXef8DfReOSsQ0LP0VI1Aj4tQs17zqKXOaUiMQUav3s7qTcIuLVaYf6w0bY3a6URV59Lj5F9+B7gkbwuAJLNPO8Dv87WeIZE8NreszPRLsTUoLrsq8OgDKiYEi4dfZH1vPpF8YhkQy+eaWImi7l7E5NNzi/k8oa6Ej/1P3aRvMuivpX8c0GRJDF5LOowG8WfGF8IkW1KeoRvYM/N7ZnIzppeMgEhKx6V+cXY1RZDUjgCO5hjUUhi9Yj1JRuInPoc5pycG0HbaMwVaZe+zyiTWRX7takuh0gQrsq1r6jg7PkcU+V8+U7QiXfwfp8KzMSr0TZxiw7DDO/Fzckg0wTsFb6Ya7RTvQPx7hM84RJ6eXzt0a+ixkKEntKaljTaW2pKvqFuTjHYq7ybisf6dnR6mjk02uqigvoVaZclDR/stLeWTqf5Q="
+        - COVERITY_SCAN_BRANCH_PATTERN="(master|coverity-.*)"
+        - COVERITY_SCAN_NOTIFICATION_EMAIL="dev at umlaeute.mur.at"
+        - COVERITY_SCAN_BUILD_COMMAND="make"
+
+matrix:
+  include:
+    - compiler: clang
+    - compiler: gcc
+      env:
+        - COVERITY_SCAN_PROJECT_NAME="$TRAVIS_REPO_SLUG"
+
+before_install:
+- sudo apt-get update -qq
+- sudo apt-get install -qq puredata-dev
+
+before_script:
+  # implement Coverity Scan with before_script instead of addons.coverity_scan
+  # to work around too-early quota check by the coverity_scan addon
+  - if [[ -n $COVERITY_SCAN_PROJECT_NAME ]] ; then curl -s 'https://scan.coverity.com/scripts/travisci_build_coverity_scan.sh' | bash || true ; fi
+
+script:
+- make
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..ebf09aa
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,57 @@
+2016-06-20  IOhannes m zmölnig <zmoelnig at umlautQ.umlaeute.mur.at>
+
+	* src/canvasdelete.c: map indices to objects before deleting them since
+	indices change when we remove a single object, we first need
+	to turn the indices to (pointers to) the objects themselves.
+
+2016-04-25  IOhannes m zmölnig <zmoelnig at iem.at>
+
+	* src/oreceive.c: fixed size-calculation of struct CID:98830
+
+2016-04-25  IOhannes m zmölnig <zmoelnig at iem.at>
+
+	* src/oreceive.c: consistent NULL-check CID:98829
+
+2016-04-25  IOhannes m zmölnig <zmoelnig at iem.at>
+
+	* .travis.yml: Travis-CI config
+
+2016-04-25  IOhannes m zmölnig <zmoelnig at iem.at>
+
+	* src/autoabstraction.c, src/canvasdelete.c: added a few FIXME
+	warnings
+
+2016-04-25  IOhannes m zmölnig <zmoelnig at iem.at>
+
+	* src/canvasargs.c, src/canvaserror.c, src/canvasname.c,
+	src/canvasselect.c, src/classtest.c: fixed a number of
+	unused-variable warnings
+
+2016-04-25  IOhannes m zmölnig <zmoelnig at iem.at>
+
+	* src/canvasconnections.c, src/canvasselect.c,
+	src/iemguts-objlist.h, src/oreceive.c, src/patcherize.c,
+	src/savebangs.c: don't cast to/from void; use sizeof(var) rather
+	than sizeof(type); this should make the code more readable and more
+	robust to type-changes.
+
+2016-04-16  IOhannes m zmölnig <zmoelnig at iem.at>
+	* src/canvasselect.c: TODO with selections
+
+2016-04-14  IOhannes m zmölnig <zmoelnig at umlautQ.umlaeute.mur.at>
+
+	* src/canvasargs.c: in-code documentation...
+
+2016-04-14  IOhannes m zmölnig <zmoelnig at umlautQ.umlaeute.mur.at>
+
+	* src/canvasargs.c: report arguments in early init phase Thanks Liam Goodacre for the bugreport.
+
+2016-04-02  IOhannes m zmölnig <zmoelnig at umlautQ.umlaeute.mur.at>
+
+	* Makefile: Drop mentioning of 'creb'
+	Closes: https://github.com/iem-projects/pd-iemguts/issues/3
+
+2016-04-01  Antoine Villeret <antoine.villeret at gmail.com>
+
+	* Makefile: add missing files for installation
+	Closes: https://github.com/iem-projects/pd-iemguts/issues/1
diff --git a/Makefile b/Makefile
index 54302e9..0b7caf3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
 #!/usr/bin/make -f
-# Makefile for pure data externals in lib creb.
-# Needs Makefile.pdlibbuilder to work (https://github.com/pure-data/pd-lib-builder)
+# Makefile to the 'iemguts' library for Pure Data.
+# Needs Makefile.pdlibbuilder as helper makefile for platform-dependent build
+# settings and rules (https://github.com/pure-data/pd-lib-builder).
 
 lib.name = iemguts
 
@@ -12,7 +13,7 @@ lib.setup.sources =
 class.sources = $(filter-out $(lib.setup.sources),$(wildcard src/*.c))
 
 datafiles = \
-$(wildcard help/*-help.pd) \
+$(wildcard help/*.pd) \
 LICENSE.txt \
 README.txt \
 iemguts-meta.pd
diff --git a/iemguts-meta.pd b/iemguts-meta.pd
index e24dc70..64ebba7 100644
--- a/iemguts-meta.pd
+++ b/iemguts-meta.pd
@@ -2,5 +2,5 @@
 #N canvas 25 49 420 300 META 1;
 #X text 13 41 NAME iemguts;
 #X text 10 25 AUTHOR forum::für::umläute;
-#X text 10 10 VERSION 0.2;
+#X text 10 10 VERSION 0.2.1;
 #X restore 10 10 pd META;
diff --git a/src/autoabstraction.c b/src/autoabstraction.c
index 56e7ae1..047f3b2 100644
--- a/src/autoabstraction.c
+++ b/src/autoabstraction.c
@@ -165,6 +165,7 @@ void autoabstraction_setup(void)
 #ifdef AUTOABSTRACTION_ENABLED
   autoabstraction_initialize();
   sys_register_loader(autoabstraction_loader);
+#warning FIXME loader-0.47 mode!
 #else
   error("autoabstraction needs to be compiled against Pd 0.40 or higher,\n");
   error("\tor a version that has sys_register_loader()");
diff --git a/src/canvasargs.c b/src/canvasargs.c
index 190570d..13c3223 100644
--- a/src/canvasargs.c
+++ b/src/canvasargs.c
@@ -57,7 +57,9 @@ static void canvasargs_list(t_canvasargs *x, t_symbol*s, int argc, t_atom*argv)
 
   if(!b)return;
 
+  /* if this method is called with a non-special selector, we *rename* the object */
   if(s==0 || s==gensym("") || s==&s_list || s==&s_bang || s==&s_float || s==&s_symbol || s==&s_) {
+    /* keep the given name */
     t_atom*ap=binbuf_getvec(b);
     s=atom_getsymbol(ap);
   }
@@ -72,21 +74,28 @@ static void canvasargs_bang(t_canvasargs *x)
 {
   int argc=0;
   t_atom*argv=0;
-  t_binbuf*b;
+  t_binbuf*b=0;
 
   if(!x->x_canvas) return;
   b=x->x_canvas->gl_obj.te_binbuf;
 
-  if(!b)return;
+  if(b) {
+    argc=binbuf_getnatom(b)-1;
+    argv=binbuf_getvec(b)+1;
+  } else {
+    canvas_setcurrent(x->x_canvas);
+    canvas_getargs(&argc, &argv);
+    canvas_unsetcurrent(x->x_canvas);
+  }
 
-  argc=binbuf_getnatom(b);
-  argv=binbuf_getvec(b);
-  outlet_list(x->x_obj.ob_outlet, &s_list, argc-1, argv+1);
+  if(argv)
+    outlet_list(x->x_obj.ob_outlet, &s_list, argc, argv);
 }
 
 
 static void canvasargs_free(t_canvasargs *x)
 {
+  x->x_canvas = 0;
 }
 
 static void *canvasargs_new(t_floatarg f)
diff --git a/src/canvasconnections.c b/src/canvasconnections.c
index d2338fd..ac98548 100644
--- a/src/canvasconnections.c
+++ b/src/canvasconnections.c
@@ -52,13 +52,13 @@ typedef struct _intvec
 
 static t_intvec*intvec_new(int initial_size)
 {
-  t_intvec*res=(t_intvec*)getbytes(sizeof(t_intvec));
+  t_intvec*res=getbytes(sizeof(*res));
   if(initial_size<1)
     initial_size=32;
   
   res->num_elements=0;
   res->size=initial_size;
-  res->elements=(int*)getbytes(res->size*sizeof(int));
+  res->elements=getbytes(res->size*sizeof(*res->elements));
 
   return res;
 }
@@ -68,13 +68,13 @@ static void intvec_free(t_intvec*vec)
 {
   if(NULL==vec)return;
   if(vec->elements)
-    freebytes(vec->elements, sizeof(int)*vec->size);
+    freebytes(vec->elements, vec->size * sizeof(*vec->elements));
   vec->elements=NULL;
 
   vec->size=0;
   vec->num_elements=0;
 
-  freebytes(vec, sizeof(t_intvec));
+  freebytes(vec, sizeof(*vec));
 }
 
 
@@ -129,8 +129,8 @@ static int query_inletconnections(t_canvasconnections *x, t_intvec***outobj, t_i
      * to find out, whether they are connected to us!
      */
 
-  invecs=getbytes(sizeof(t_intvec*)*ninlets);
-  inwhich=getbytes(sizeof(t_intvec*)*ninlets);
+  invecs =getbytes(ninlets*sizeof(*invecs));
+  inwhich=getbytes(ninlets*sizeof(*inwhich));
   for(i=0; i<ninlets; i++){
     invecs[i]=intvec_new(0);
     inwhich[i]=intvec_new(0);
@@ -188,7 +188,7 @@ static void canvasconnections_queryinlets(t_canvasconnections *x)
   for(i=0; i<ninlets; i++){
     int size=invecs[i]->num_elements;
     if(size>0) {
-      t_atom*ap=getbytes(sizeof(t_atom)*(size+1));
+      t_atom*ap=getbytes((size+1)*sizeof(*ap));
       int j=0;
       t_symbol*s=gensym("inlet");
 
@@ -197,11 +197,11 @@ static void canvasconnections_queryinlets(t_canvasconnections *x)
         SETFLOAT(ap+j+1, ((t_float)invecs[i]->elements[j]));
       
       outlet_anything(x->x_out, s, size+1, ap);
-      freebytes(ap, sizeof(t_atom)*(size+1));
+      freebytes(ap, (size+1) * sizeof(*ap));
     }
     intvec_free(invecs[i]);
   }
-  if(invecs)freebytes(invecs, sizeof(t_intvec*)*ninlets);
+  if(invecs)freebytes(invecs, ninlets * sizeof(*invecs));
 }
 
 static void canvasconnections_inlet(t_canvasconnections *x, t_floatarg f)
@@ -212,7 +212,7 @@ static void canvasconnections_inlet(t_canvasconnections *x, t_floatarg f)
 
   if(inlet >= 0 && inlet < ninlets) {
     int size=invecs[inlet]->num_elements;
-    t_atom*ap=getbytes(sizeof(t_atom)*(size+1));
+    t_atom*ap=getbytes((size+1)*sizeof(*ap));
     t_symbol*s=gensym("inlet");
     if(obj_issignalinlet(x->x_object,inlet)) {
       s=gensym("inlet~");
@@ -227,11 +227,11 @@ static void canvasconnections_inlet(t_canvasconnections *x, t_floatarg f)
     }
       
     outlet_anything(x->x_out, s, size+1, ap);
-    freebytes(ap, sizeof(t_atom)*(size+1));
+    freebytes(ap, (size+1) * sizeof(*ap));
 
     intvec_free(invecs[inlet]);
   }
-  if(invecs)freebytes(invecs, sizeof(t_intvec*)*ninlets);
+  if(invecs)freebytes(invecs, ninlets * sizeof(*invecs));
 }
 
 
@@ -283,8 +283,8 @@ static void canvasconnections_inconnect(t_canvasconnections *x, t_floatarg f)
       intvec_free(inwhich[i]);
     }
   }
-  if(invecs)freebytes(invecs, sizeof(t_intvec*)*ninlets);
-  if(inwhich)freebytes(inwhich, sizeof(t_intvec*)*ninlets);
+  if(invecs) freebytes(invecs , ninlets * sizeof(*invecs));
+  if(inwhich)freebytes(inwhich, ninlets * sizeof(*inwhich));
 }
 
 
@@ -371,7 +371,7 @@ static void canvasconnections_outlet(t_canvasconnections *x, t_floatarg f)
       conn=obj_nexttraverseoutlet(conn, &dest, &in, &which);
       count++;
     }
-    abuf=(t_atom*)getbytes(sizeof(t_atom)*(count+1));
+    abuf=getbytes((count+1)*sizeof(*abuf));
     SETFLOAT(abuf, outlet);
 
     if(count>0) {
@@ -387,7 +387,7 @@ static void canvasconnections_outlet(t_canvasconnections *x, t_floatarg f)
       }
     }
     outlet_anything(x->x_out, s, count+1, abuf);
-    freebytes(abuf, sizeof(t_atom)*(count+1));
+    freebytes(abuf, (count+1) * sizeof(*abuf));
   }
 }
 
@@ -413,7 +413,7 @@ static void canvasconnections_queryoutlets(t_canvasconnections *x)
     }
     if(count>0) {
       int i=0;
-      t_atom*abuf=(t_atom*)getbytes(sizeof(t_atom)*(count+1));
+      t_atom*abuf=getbytes((count+1)*sizeof(*abuf));
       SETFLOAT(abuf, nout);
       conn=obj_starttraverseoutlet(x->x_object, &out, nout);
       while(conn) {
@@ -425,7 +425,7 @@ static void canvasconnections_queryoutlets(t_canvasconnections *x)
         i++;
       }
       outlet_anything(x->x_out, gensym("outlet"), count+1, abuf);
-      freebytes(abuf, sizeof(t_atom)*(count+1));
+      freebytes(abuf, (count+1) * sizeof(*abuf));
     }
   }
 }
diff --git a/src/canvasdelete.c b/src/canvasdelete.c
index 9e9f934..798cf33 100644
--- a/src/canvasdelete.c
+++ b/src/canvasdelete.c
@@ -115,45 +115,54 @@ void canvasdelete_setup(void)
 
 
 /* 'delete' message for the canvas */
-static int canvas_delete_docb(t_glist*glist, int index) {
+static int canvas_delete_docb(t_glist*glist, t_gobj*wantobj) {
   /* this will crash Pd if the object to be deleted is on the stack
    * workarounds:
    *   - use a clock (see above)
    *   - finally fix this in Pd
    */
   t_gobj*obj=NULL;
-  int i=index;
-  if(NULL==glist) {
-    return -1;
+  if(!glist || !wantobj)
+    return 0;
+  for(obj=glist->gl_list; obj; obj=obj->g_next) {
+    if(wantobj == obj)
+      break;
   }
-  if(i<0) {
-    return -1;
-  }
-
-  obj=glist->gl_list;
+  if(!obj)
+    return 0;
 
-  while(i-- && obj) {
-    obj=obj->g_next;
-  }
+  glist_delete(glist, obj);
+  return 1;
+}
 
-  if(obj) {
-    glist_delete(glist, obj);
-  }
-  else {
-    return -1;
+static t_gobj**canvasdelete_indices2glist(const t_glist*glist, unsigned int argc, t_atom*argv) {
+  t_gobj**result = malloc(argc*sizeof(*result));
+  t_gobj**resptr=result;
+  int i=0;
+  for(i=0; i<argc; i++)result[i]=NULL;
+  for(i=0; i<argc; i++) {
+    int index=atom_getint(argv+i);
+    t_gobj*obj=glist->gl_list;
+    /* get handle to object */
+    while(index-->0 && obj) {
+      obj=obj->g_next;
+    }
+    if(obj) {
+      *resptr++=obj;
+    }
   }
-
-  return index;
+  return result;
 }
 
 static void canvas_delete_cb(t_canvas*x, t_symbol*s, int argc, t_atom*argv)
 {
   int dspstate= canvas_suspend_dsp();
-  if(argc) {
-    while(argc--){
-      canvas_delete_docb(x, atom_getint(argv++));
-    }
+  t_gobj**objs=canvasdelete_indices2glist(x, argc>0?argc:0, argv);
+  int i;
+  for(i=0; i<argc; i++) {
+    canvas_delete_docb(x, objs[i]);
   }
+  free(objs);
   canvas_resume_dsp(dspstate);
 }
 
diff --git a/src/canvaserror.c b/src/canvaserror.c
index 5c38f46..ace55d9 100644
--- a/src/canvaserror.c
+++ b/src/canvaserror.c
@@ -77,6 +77,7 @@ static void canvaserror_any(t_canvaserror *x, t_symbol*s, int argc, t_atom*argv)
 
 static void canvaserror_free(t_canvaserror *x)
 {
+  x->x_canvas = 0;
 }
 
 static void *canvaserror_new(t_floatarg f)
diff --git a/src/canvasname.c b/src/canvasname.c
index bf7cc14..0f13564 100644
--- a/src/canvasname.c
+++ b/src/canvasname.c
@@ -55,7 +55,6 @@ static void canvasname_bang(t_canvasname *x)
 {
   t_canvas*c=x->x_canvas;
   t_binbuf*b=0;
-  t_atom name[1];
 
   if(!c) return;
 
@@ -80,9 +79,7 @@ static void canvasname_bang(t_canvasname *x)
 
 static void canvasname_symbol(t_canvasname *x, t_symbol*s)
 {
-  t_canvas*c=x->x_canvas;
   t_binbuf*b=0;
-  t_atom name[1];
   if(!x->x_canvas) return;
   b=x->x_canvas->gl_obj.te_binbuf;
 
diff --git a/src/canvasselect.c b/src/canvasselect.c
index ed7f50b..f68f4f5 100644
--- a/src/canvasselect.c
+++ b/src/canvasselect.c
@@ -1,4 +1,3 @@
-
 /******************************************************
  *
  * canvasselect - implementation file
@@ -16,11 +15,15 @@
  ******************************************************/
 
 
-/* 
+/*
  * this object allows to select other objects on the canvas
  * it also allows to query the selection of the canvas
- * 
+ *
  * it also adds a "select" message to the canvas
+ *
+ * TODO:
+ *  - save selection to file
+ *  - patcherize selection
  */
 
 #include "iemguts.h"
@@ -49,7 +52,7 @@ static void canvasselect_bang(t_canvasselect *x)
     return;
   }
   int nselected=0;
-  
+
   for(obj=glist->gl_list; obj; obj=obj->g_next, index++) {
     if(glist_isselected(glist, obj)) {
       // post("selected: %d", index);
@@ -59,16 +62,16 @@ static void canvasselect_bang(t_canvasselect *x)
   int n=0;
   index=0;
   t_atom *atombuf;
-  
-  atombuf = (t_atom *)getbytes(sizeof(t_atom)*nselected);
-  
+
+  atombuf = getbytes(nselected*sizeof(*atombuf));
+
   for(obj=glist->gl_list; obj; obj=obj->g_next, index++) {
     if(glist_isselected(glist, obj)) {
       SETFLOAT(&atombuf[n], index);
       n++;
     }
   }
-  
+
   outlet_list(x->x_obj.ob_outlet, &s_list, nselected, atombuf);
 }
 
@@ -191,7 +194,7 @@ static void *canvasselect_new(t_floatarg f)
   t_glist *glist=(t_glist *)canvas_getcurrent();
   t_canvas *canvas=(t_canvas*)glist_getcanvas(glist);
   int depth=(int)f;
-  
+
   if(depth<0)depth=0;
 
   while(depth && canvas) {
@@ -200,14 +203,15 @@ static void *canvasselect_new(t_floatarg f)
   }
 
   x->x_canvas = canvas;
-  
+
+
   outlet_new(&x->x_obj, 0);
   return (x);
 }
 
 static void canvasselect_free(t_canvasselect*x)
 {
-
+  x->x_canvas = 0;
 }
 
 static void canvas_select_cb(t_canvas*x, t_float f)
@@ -243,8 +247,8 @@ static void register_methods(void)
 void canvasselect_setup(void)
 {
   iemguts_boilerplate("[canvasselect] - (de)select messages for canvas", 0);
-  canvasselect_class = class_new(gensym("canvasselect"), 
-                                 (t_newmethod)canvasselect_new, (t_method)canvasselect_free, 
+  canvasselect_class = class_new(gensym("canvasselect"),
+                                 (t_newmethod)canvasselect_new, (t_method)canvasselect_free,
                                  sizeof(t_canvasselect), 0,
                                  A_DEFFLOAT, 0);
   class_addbang(canvasselect_class, (t_method)canvasselect_bang);
diff --git a/src/classtest.c b/src/classtest.c
index 4c38f37..bb4183e 100644
--- a/src/classtest.c
+++ b/src/classtest.c
@@ -59,7 +59,7 @@ static void classtest_free(t_classtest *x)
   outlet_free(x->x_out);
 }
 
-static void *classtest_new(t_floatarg f)
+static void *classtest_new(void)
 {
   t_classtest *x = (t_classtest *)pd_new(classtest_class);
 
diff --git a/src/iemguts-objlist.h b/src/iemguts-objlist.h
index 8f9e9ac..b54d23a 100644
--- a/src/iemguts-objlist.h
+++ b/src/iemguts-objlist.h
@@ -63,7 +63,7 @@ static t_iemguts_canvaslist*addCanvas(const t_pd*parent)
 {
   t_iemguts_canvaslist*list=findCanvas(parent);
   if(!list) {
-    list=(t_iemguts_canvaslist*)getbytes(sizeof(t_iemguts_canvaslist));
+    list=getbytes(sizeof(*list));
     list->parent=parent;
     list->obj=0;
     list->next=0;
@@ -108,7 +108,7 @@ static void addObjectToCanvas(const t_pd*parent, const t_pd*obj) {
   }
 
   /* we are at the end of the list that does not contain obj yet, so add it */
-  entry=(t_iemguts_objlist*)getbytes(sizeof(t_iemguts_objlist));
+  entry=getbytes(sizeof(*entry));
   entry->obj=obj;
   entry->next=0;
   if(list) {
@@ -141,7 +141,7 @@ static void removeObjectFromCanvas(const t_pd*parent, const t_pd*obj) {
   else
     p->obj=next;
 
-  freebytes((void*)list, sizeof(t_iemguts_objlist));
+  freebytes(list, sizeof(*list));
   list=0;
 }
 
diff --git a/src/oreceive.c b/src/oreceive.c
index 138f844..8c4c4b1 100644
--- a/src/oreceive.c
+++ b/src/oreceive.c
@@ -151,7 +151,7 @@ static void pd_bind_priority(t_pd*x, t_symbol*key, t_float priority) {
     bind_list=guts_add_key(key);
   if(!bind_list)return;
 
-  element=(t_bind_element*)getbytes(sizeof(t_bind_element));
+  element=getbytes(sizeof(*element));
   element->object=x;
   element->priority=priority;
   element->next=0;
@@ -187,7 +187,7 @@ static void pd_unbind_priority(t_pd*x, t_symbol*key) {
     elements->priority=0;
     elements->next=0;
 
-    freebytes(elements, sizeof(elements));
+    freebytes(elements, sizeof(*elements));
   } else {
     // not here...
   }
@@ -248,8 +248,8 @@ static void oreceive_priority(t_oreceive *x, t_float p)
   x->x_priority=p;
   if(x->x_sym) {
     pd_unbind_priority(&x->x_obj.ob_pd, x->x_sym);
+    pd_bind_priority(&x->x_obj.ob_pd, x->x_sym, x->x_priority);
   }
-  pd_bind_priority(&x->x_obj.ob_pd, x->x_sym, x->x_priority);
 }
 
 static void oreceive_name(t_oreceive *x, t_symbol*s)
diff --git a/src/savebangs.c b/src/savebangs.c
index b256478..491a25a 100644
--- a/src/savebangs.c
+++ b/src/savebangs.c
@@ -67,7 +67,7 @@ static void add_savefn(t_class*class)
   if(0!=find_savefn(class)) {
     return;
   } else {
-    t_savefuns*sfun=(t_savefuns*)getbytes(sizeof(t_savefuns));
+    t_savefuns*sfun=getbytes(sizeof(*sfun));
     sfun->class=class;
     sfun->savefn=class_getsavefn(class);
     sfun->next=0;

-- 
pd-iemguts packaging



More information about the pkg-multimedia-commits mailing list