File: compiler-warnings.patch

package info (click to toggle)
amide 1.0.6-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,904 kB
  • sloc: ansic: 51,916; cpp: 2,332; xml: 1,995; makefile: 674; sh: 129
file content (198 lines) | stat: -rw-r--r-- 5,650 bytes parent folder | download | duplicates (2)
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
Description: Fix some compiler warnings.
Author: Yavor Doganov <yavor@gnu.org>
Forwarded: no
Last-Update: 2022-02-22
---

--- amide.orig/amide-current/src/amitk_point.c
+++ amide/amide-current/src/amitk_point.c
@@ -49,7 +49,7 @@
 }
 
 AmitkPoint * amitk_point_copy(const AmitkPoint * point) {
-  return (AmitkPoint *)g_memdup(point, sizeof(AmitkPoint));
+  return (AmitkPoint *)g_memdup2(point, sizeof(AmitkPoint));
 }
 
 void amitk_point_free (AmitkPoint * point) {
@@ -145,7 +145,7 @@
 }
 
 AmitkVoxel * amitk_voxel_copy(const AmitkVoxel * voxel) {
-  return (AmitkVoxel *)g_memdup(voxel, sizeof(AmitkVoxel));
+  return (AmitkVoxel *)g_memdup2(voxel, sizeof(AmitkVoxel));
 }
 
 void amitk_voxel_free (AmitkVoxel * voxel) {
@@ -223,7 +223,7 @@
 }
 
 AmitkPixel * amitk_pixel_copy(const AmitkPixel * pixel) {
-  return (AmitkPixel *)g_memdup(pixel, sizeof(AmitkPixel));
+  return (AmitkPixel *)g_memdup2(pixel, sizeof(AmitkPixel));
 }
 
 void amitk_pixel_free (AmitkPixel * pixel) {
@@ -242,7 +242,7 @@
 }
 
 AmitkCanvasPoint * amitk_canvas_point_copy(const AmitkCanvasPoint * point) {
-  return (AmitkCanvasPoint *)g_memdup(point, sizeof(AmitkCanvasPoint));
+  return (AmitkCanvasPoint *)g_memdup2(point, sizeof(AmitkCanvasPoint));
 }
 
 void amitk_canvas_point_free (AmitkCanvasPoint * point) {
@@ -265,7 +265,7 @@
 }
 
 AmitkAxes * amitk_axes_copy(const AmitkAxes * axes) {
-  return (AmitkAxes *)g_memdup(axes, sizeof(AmitkAxes));
+  return (AmitkAxes *)g_memdup2(axes, sizeof(AmitkAxes));
 }
 
 void amitk_axes_free (AmitkAxes * axes) {
@@ -503,7 +503,7 @@
 }
 
 AmitkCorners * amitk_corners_copy(const AmitkCorners * corners) {
-  return (AmitkCorners *)g_memdup(corners, sizeof(AmitkCorners));
+  return (AmitkCorners *)g_memdup2(corners, sizeof(AmitkCorners));
 }
 
 void amitk_corners_free (AmitkCorners * corners) {
--- amide.orig/amide-current/src/fads.c
+++ amide/amide-current/src/fads.c
@@ -484,6 +484,7 @@
   return;
 }
 
+#if AMIDE_DEBUG
 static gdouble calc_magnitude(AmitkDataSet * ds, gdouble * weight) {
 
   gdouble magnitude;
@@ -506,6 +507,7 @@
 
   return sqrt(magnitude);
 }
+#endif
 
 
 /* returned array needs to be free'd */
@@ -909,7 +911,6 @@
   gdouble alpha, factor;
   amide_time_t frame_midpoint, frame_duration;
   gdouble init_value;
-  gdouble magnitude;
   AmitkDataSet * new_ds;
   AmitkVoxel i_voxel;
   gdouble current_beta=0.0;
@@ -917,6 +918,7 @@
   GTimer * timer=NULL;
   gboolean new_outer;
 #if AMIDE_DEBUG
+  gdouble magnitude;
   div_t x;
 #endif
 
@@ -977,7 +979,9 @@
     g_warning(_("failed weight malloc"));
     goto ending;
   }
+#if AMIDE_DEBUG
   magnitude = calc_magnitude(p.data_set, p.weight);
+#endif
 
   if (p.sum_factors_equal_one) {
     p.ec_a = g_try_new(gdouble, p.num_voxels);
@@ -1942,12 +1946,13 @@
   amide_time_t time_start;
   AmitkDataSet * new_ds;
   AmitkVoxel i_voxel;
-  gdouble magnitude, k12, k21;
+  gdouble k12, k21;
   gdouble init_value, alpha;
   AmitkViewMode i_view_mode;
   GTimer * timer=NULL;
   gboolean new_outer;
 #if AMIDE_DEBUG
+  gdouble magnitude;
   div_t x;
 #endif
 
@@ -2100,7 +2105,9 @@
   /* calculate the weights and magnitude */
   p.weight = calc_weights(p.data_set);
   g_return_if_fail(p.weight != NULL); /* make sure we've malloc'd it */
+#if AMIDE_DEBUG
   magnitude = calc_magnitude(p.data_set, p.weight);
+#endif
 
   
   /* set up gsl */
--- amide.orig/amide-current/src/libmdc_interface.c
+++ amide/amide-current/src/libmdc_interface.c
@@ -933,12 +933,12 @@
 
   /* set what we can */
   if (AMITK_DATA_SET_SUBJECT_NAME(ds) != NULL) 
-    strncpy(fi.patient_name,AMITK_DATA_SET_SUBJECT_NAME(ds), MDC_MAXSTR);
+    strncpy(fi.patient_name,AMITK_DATA_SET_SUBJECT_NAME(ds), MDC_MAXSTR - 1);
   if (AMITK_DATA_SET_SUBJECT_ID(ds) != NULL) 
-    strncpy(fi.patient_id,AMITK_DATA_SET_SUBJECT_ID(ds), MDC_MAXSTR);
+    strncpy(fi.patient_id,AMITK_DATA_SET_SUBJECT_ID(ds), MDC_MAXSTR - 1);
   if (AMITK_DATA_SET_SUBJECT_DOB(ds) != NULL) 
-    strncpy(fi.patient_dob,AMITK_DATA_SET_SUBJECT_DOB(ds), MDC_MAXSTR);
-  strncpy(fi.patient_sex, amitk_subject_sex_get_name(AMITK_DATA_SET_SUBJECT_SEX(ds)), MDC_MAXSTR);
+    strncpy(fi.patient_dob,AMITK_DATA_SET_SUBJECT_DOB(ds), MDC_MAXSTR - 1);
+  strncpy(fi.patient_sex, amitk_subject_sex_get_name(AMITK_DATA_SET_SUBJECT_SEX(ds)), MDC_MAXSTR - 1);
 
   fi.injected_dose = AMITK_DATA_SET_INJECTED_DOSE(ds);
   fi.patient_weight= AMITK_DATA_SET_SUBJECT_WEIGHT(ds);
--- amide.orig/amide-current/src/mpeg_encode.c
+++ amide/amide-current/src/mpeg_encode.c
@@ -151,7 +151,7 @@
 
 
 typedef struct {
-  AVCodec *codec;
+  const AVCodec *codec;
   AVCodecContext *context;
   AVFrame *picture;
   yuv_t * yuv; 
--- amide.orig/amide-current/src/vistaio_interface.c
+++ amide/amide-current/src/vistaio_interface.c
@@ -37,7 +37,7 @@
 #include <locale.h>
 
 
-gboolean vistaio_test_vista(gchar *filename)
+gboolean vistaio_test_vista(const gchar *filename)
 {
   return VistaIOIsVistaFile(filename); 
 }
--- amide.orig/amide-current/src/vistaio_interface.h
+++ amide/amide-current/src/vistaio_interface.h
@@ -33,7 +33,7 @@
 /* includes always needed with this file */
 #include "amitk_data_set.h"
 
-gboolean vistaio_test_vista(gchar *filename); 
+gboolean vistaio_test_vista(const gchar *filename);
 
 
 /* external functions */
--- amide.orig/amide-current/configure.ac
+++ amide/amide-current/configure.ac
@@ -366,9 +366,9 @@
 ##############################
 
 PKG_CHECK_MODULES(AMIDE_GTK,[
-	glib-2.0	>= 2.44.0
-	gio-2.0         >= 2.44.0
-	gobject-2.0	>= 2.44.0
+	glib-2.0	>= 2.68.0
+	gio-2.0         >= 2.68.0
+	gobject-2.0	>= 2.68.0
 	gtk+-3.0	>= 3.21.5
 	libxml-2.0	>= 2.4.12
 	goocanvas-2.0   >= 2.0.2