File: pd_error.patch

package info (click to toggle)
pd-iemmatrix 0.3.2-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,848 kB
  • sloc: ansic: 13,804; makefile: 605; sh: 90
file content (146 lines) | stat: -rw-r--r-- 4,744 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
Description: Use pd_error() instead of the deprecated error()
Author: IOhannes m zmölnig
Origin: Debian
Forwarded: not-needed
Last-Update: 2022-09-28
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- pd-iemmatrix.orig/src/mtx_concat.c
+++ pd-iemmatrix/src/mtx_concat.c
@@ -49,7 +49,7 @@
     mtx_concat_obj->concat_mode = 0;
     break;
   default:
-    error("mtx_concat: invalid mode '%s'", c_mode->s_name);
+    pd_error(mtx_concat_obj, "mtx_concat: invalid mode '%s'", c_mode->s_name);
     break;
   }
 }
--- pd-iemmatrix.orig/src/mtx_fill.c
+++ pd-iemmatrix/src/mtx_fill.c
@@ -152,13 +152,16 @@
 
 static void *newMTXFill (t_symbol *s, int argc, t_atom *argv)
 {
+  static int first_time = 1;
   MTXfill *mtx_fill_obj = (MTXfill *) pd_new (mtx_fill_class);
 
   mtx_fill_obj->size = 0;
   mtx_fill_obj->fill_startrow = 1;
   mtx_fill_obj->fill_startcol = 1;
   mtx_fill_obj->fill_type = DONT_FILL_JUST_PASS;
-  error("[mtx_fill]: this object _might_ change in the future!");
+  if(first_time)
+      pd_error(mtx_fill_obj, "[mtx_fill]: this object _might_ change in the future!");
+  first_time = 0;
   if (argc) {
     if (atom_getsymbol(argv)==gensym("matrix")) {
       mTXFillIndexMatrix (mtx_fill_obj, s, argc-1, argv+1);
--- pd-iemmatrix.orig/src/mtx_find.c
+++ pd-iemmatrix/src/mtx_find.c
@@ -67,6 +67,7 @@
 
 static void *newMTXFind (t_symbol *s, int argc, t_atom *argv)
 {
+  static int first_time = 1;
   MTXfind *mtx_find_obj = (MTXfind *) pd_new (mtx_find_class);
 
   mTXSetFindMode (mtx_find_obj, gensym(":"));
@@ -106,7 +107,9 @@
   mtx_find_obj->list_outlet = outlet_new (&mtx_find_obj->x_obj,
                                           gensym("matrix"));
 
-  error("[mtx_find]: this object is likely to change! not really for use yet");
+  if (first_time)
+      pd_error(mtx_find_obj, "[mtx_find]: this object is likely to change! not really for use yet");
+  first_time = 0;
   return ((void *) mtx_find_obj);
 }
 
--- pd-iemmatrix.orig/src/mtx_index.c
+++ pd-iemmatrix/src/mtx_index.c
@@ -47,6 +47,7 @@
 
 static void *newMTXIndex (t_symbol *s, int argc, t_atom *argv)
 {
+  static int first_time = 1;
   MTXindex *mtx_index_obj = (MTXindex *) pd_new (mtx_index_class);
   t_atom fill_atom;
 
@@ -70,7 +71,9 @@
   inlet_new(&mtx_index_obj->x_obj, &mtx_index_obj->x_obj.ob_pd,
             gensym("matrix"),gensym(""));
 
-  error("[mtx_index]: this object is likely to change! not really for use yet");
+  if (first_time)
+      pd_error(mtx_index_obj, "[mtx_index]: this object is likely to change! not really for use yet");
+  first_time = 0;
 
   return ((void *) mtx_index_obj);
 }
--- pd-iemmatrix.orig/src/mtx_mul.c
+++ pd-iemmatrix/src/mtx_mul.c
@@ -29,7 +29,7 @@
 
 static int matchingdimension(void*x, int col, int row, t_matrix*m) {
   if ((col!=m->col)||(row!=m->row)) {
-    pd_error(x, "%smatrix dimension do not match (%dx%d != %dx%d)",
+    pd_error(x, "%s: matrix dimension do not match (%dx%d != %dx%d)",
         iemmatrix_objname(x),
         col, row, m->col, m->row);
     return 0;
@@ -179,11 +179,11 @@
 
 static void *mtx_mul_new(t_symbol *s, int argc, t_atom *argv)
 {
-  if (argc>1) {
-    error("[%s]: extra arguments ignored", s->s_name);
-  }
   if (argc) {
     t_mtx_binscalar *x = (t_mtx_binscalar *)pd_new(mtx_mulscalar_class);
+    if (argc>1) {
+      pd_error(x, "[%s]: extra arguments ignored", s->s_name);
+    }
     floatinlet_new(&x->x_obj, &x->f);
     x->f = atom_getfloatarg(0, argc, argv);
     outlet_new(&x->x_obj, 0);
@@ -347,12 +347,12 @@
 
 static void *mtx_div_new(t_symbol *s, int argc, t_atom *argv)
 {
-  if (argc>1) {
-    error("[%s] extra arguments ignored", s->s_name);
-  }
   if (argc) {
     /* scalar division */
     t_mtx_binscalar *x = (t_mtx_binscalar *)pd_new(mtx_divscalar_class);
+    if (argc>1) {
+      pd_error(x, "[%s] extra arguments ignored", s->s_name);
+    }
     floatinlet_new(&x->x_obj, &x->f);
     x->f = atom_getfloatarg(0, argc, argv);
     outlet_new(&x->x_obj, 0);
--- pd-iemmatrix.orig/src/mtx_reverse.c
+++ pd-iemmatrix/src/mtx_reverse.c
@@ -56,7 +56,7 @@
     mtx_reverse_obj->reverse_mode = -1;
     break;
   default:
-    error("mtx_reverse: invalid mode '%s'", c_mode->s_name);
+    pd_error(mtx_reverse_obj, "mtx_reverse: invalid mode '%s'", c_mode->s_name);
     break;
   }
 }
@@ -125,10 +125,10 @@
 
   /* size check */
   if (!size) {
-    error("mtx_reverse: invalid dimensions");
+    pd_error(mtx_reverse_obj, "mtx_reverse: invalid dimensions");
     return;
   } else if (list_size<size) {
-    error("mtx_reverse: sparse matrix not yet supported: use \"mtx_check\"");
+    pd_error(mtx_reverse_obj, "mtx_reverse: sparse matrix not yet supported: use \"mtx_check\"");
     return;
   }