Package: lynkeos.app / 3.8+dfsg-1

gcc-warnings.patch Patch series | 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
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
Description: Fix some compiler warnings.
 Also check the return value of fread/fgets.
 .
 comparison of distinct pointer types lacks a cast
 assignment makes integer from pointer without a cast [-Wint-conversion]
 'main' is usually a function [-Wmain]
 'foo' may be used uninitialized in this function
 missing braces around initializer [-Wmissing-braces]
 passing argument N of ‘foo:’ from distinct Objective-C type
 passing argument N of ‘foo:’ from incompatible pointer type
 initialization of ‘double *’ from incompatible pointer type ‘id’
 initialization from distinct Objective-C type
 "GNUSTEP" redefined
Author: Yavor Doganov <yavor@gnu.org>
Forwarded: no
Last-Update: 2025-04-09
---

--- lynkeos.app.orig/application/Sources/FFmpegReader.m
+++ lynkeos.app/application/Sources/FFmpegReader.m
@@ -200,7 +200,7 @@
       return( pix->_frame );
 
    int ret;
-   BOOL success;
+   BOOL success = NO;
 
    // Do not move if the frame already read is asked
    if ( index == (_nextIndex - 1) )
@@ -442,7 +442,7 @@
          _height = (_pCodecCtx->height * aspect.num) / aspect.den;
       }
       const AVPixFmtDescriptor *fmtDesc = av_pix_fmt_desc_get(_pCodecCtx->pix_fmt);
-      if (fmtDesc == nil)
+      if (fmtDesc == NULL)
       {
          NSLog( @"Unknown pixel format" );
          [self release];
--- lynkeos.app.orig/application/Sources/MyImageListWindow.m
+++ lynkeos.app/application/Sources/MyImageListWindow.m
@@ -625,10 +625,11 @@
 
 - (void)windowDidBecomeMain:(NSNotification *)aNotification
 {
-   NSWindow *main = [self window];
+   NSWindow *mainWindow = [self window];
    NSWindow *sender = [aNotification object];
 
-   NSAssert1( sender == main, @"Unexpected window becomes main : %@", sender );
+   NSAssert1( sender == mainWindow,
+              @"Unexpected window becomes main : %@", sender );
 
    if ( _currentProcessDisplay == SeparateView
        || _currentProcessDisplay == SeparateView_NoList )
@@ -644,10 +645,11 @@
 
 - (void)windowDidResignMain:(NSNotification *)aNotification
 {
-   NSWindow *main = [self window];
+   NSWindow *mainWindow = [self window];
    NSWindow *sender = [aNotification object];
 
-   NSAssert1( sender == main, @"Unexpected window becomes main : %@", sender );
+   NSAssert1( sender == mainWindow,
+              @"Unexpected window becomes main : %@", sender );
 
    if ( _currentProcessDisplay == SeparateView
        || _currentProcessDisplay == SeparateView_NoList )
@@ -1470,7 +1472,7 @@
 
 - (void) showHideImageList:(id)sender
 {
-   LynkeosProcessingViewFrame_t display;
+   LynkeosProcessingViewFrame_t display = BottomTab;
 
    switch( _currentProcessDisplay )
    {
@@ -1488,7 +1490,7 @@
 
 - (void) attachDetachProcessView:(id)sender
 {
-   LynkeosProcessingViewFrame_t display;
+   LynkeosProcessingViewFrame_t display = BottomTab;
 
    switch( _currentProcessDisplay )
    {
@@ -1598,7 +1600,7 @@
 
    if (img != nil)
    {
-      NSPoint offsets[3] = {0.0, 0.0, 0.0};
+      NSPoint offsets[3] = {{0.0}, {0.0}, {0.0}};
       LynkeosIntegerRect r = ctrl->cropRectangle;
       u_short x, y, c;
 
--- lynkeos.app.orig/application/Sources/MyProcessingThread.m
+++ lynkeos.app/application/Sources/MyProcessingThread.m
@@ -145,7 +145,7 @@
    NSAutoreleasePool *pool;
    NSPort *rxPort;
    LynkeosThreadConnection *cnx;
-   MyProcessingThread *threadController;
+   MyProcessingThread *threadController = nil;
    MyDocument *doc;
 
    pool = [[NSAutoreleasePool alloc] init];
--- lynkeos.app.orig/application/Sources/MyTiff16Reader.m
+++ lynkeos.app/application/Sources/MyTiff16Reader.m
@@ -280,7 +280,7 @@
 
             for( xs = x; xs < x+w; xs++ )
             {
-               float v;
+               float v = 0;
 
                switch ( _nBits )
                {
--- lynkeos.app.orig/application/Sources/MyTiffWriter.m
+++ lynkeos.app/application/Sources/MyTiffWriter.m
@@ -89,7 +89,7 @@
    void *buf;
    u_short s, x, y, c;
    u_long hstrip;
-   double max;
+   double max = 0;
 
    // Choose a strip size
    hstrip = 256*1024/scanLineW;
--- lynkeos.app.orig/application/GNUstep/GNUmakefile
+++ lynkeos.app/application/GNUstep/GNUmakefile
@@ -103,7 +103,8 @@
 			 -lcfitsio -lpthread $(LIBRAW_LIBS)
 #ADDITIONAL_LIB_DIRS += 
 
-ADDITIONAL_OBJCFLAGS += -std=gnu99 -Wno-unknown-pragmas
+ADDITIONAL_OBJCFLAGS += -std=gnu99 -Wno-unknown-pragmas -Wno-cpp
+ADDITIONAL_CFLAGS += -Wno-cpp
 ADDITIONAL_CPPFLAGS += -I. -I.. -I$(PWD).. -I$(PWD)/../Sources \
 -I$(PWD)/../ThreadConnectionSources \
 -I$(PWD)/../ThirdPartySources/SMDoubleSlider -DNO_FRAMEWORK_CHECK=1
--- lynkeos.app.orig/application/Sources/MyImageStacker.m
+++ lynkeos.app/application/Sources/MyImageStacker.m
@@ -232,7 +232,7 @@
    else
    {
       LynkeosImageBuffer* image = nil;
-      NSPoint offsets[3] = {0.0, 0.0, 0.0};
+      NSPoint offsets[3] = {{0.0}, {0.0}, {0.0}};
       LynkeosIntegerRect r = _params->_cropRectangle;
 
       id <LynkeosAlignResult> alignRes
--- lynkeos.app.orig/application/Sources/LynkeosBasicAlignResult.m
+++ lynkeos.app/application/Sources/LynkeosBasicAlignResult.m
@@ -29,6 +29,10 @@
 #define K_ALIGN_OFFSET        @"offset"
 #define K_ALIGN_TRANSFORM     @"transform"
 
+@interface LynkeosBasicAlignResult(Private)
+- (void) cacheValues;
+@end
+
 @implementation LynkeosBasicAlignResult(Private)
 - (void) cacheValues
 {
--- lynkeos.app.orig/application/Sources/MyImageAlignerView.m
+++ lynkeos.app/application/Sources/MyImageAlignerView.m
@@ -729,7 +729,7 @@
       NSNumberFormatter *xFormat = [[NSNumberFormatter alloc] init];
       [xFormat setFormatterBehavior:NSNumberFormatterBehavior10_4];
       [xFormat setAllowsFloats:NO];
-      [xFormat setMinimum:[NSNumber numberWithInt:0]];
+      [xFormat setMinimum:[NSDecimalNumber zero]];
       [_xField setFormatter:xFormat];
       [_xField setEditable:YES];
 
@@ -737,7 +737,7 @@
       NSNumberFormatter *yFormat = [[NSNumberFormatter alloc] init];
       [yFormat setFormatterBehavior:NSNumberFormatterBehavior10_4];
       [yFormat setAllowsFloats:NO];
-      [yFormat setMinimum:[NSNumber numberWithInt:0]];
+      [yFormat setMinimum:[NSDecimalNumber zero]];
       [_yField setFormatter:yFormat];
       [_yField setEditable:YES];
 
@@ -745,7 +745,8 @@
       NSNumberFormatter *sizeFormat = [[NSNumberFormatter alloc] init];
       [sizeFormat setFormatterBehavior:NSNumberFormatterBehavior10_4];
       [sizeFormat setAllowsFloats:NO];
-      [sizeFormat setMinimum:[NSNumber numberWithInt:2]];
+      [sizeFormat setMinimum:
+                    [[[NSDecimalNumber alloc] initWithInt:2] autorelease]];
       [_sizeField setFormatter:sizeFormat];
       [_sizeField setControlSize:NSControlSizeSmall];
       [_sizeField setEditable:YES];
--- lynkeos.app.orig/application/Sources/MyImageListItem.m
+++ lynkeos.app/application/Sources/MyImageListItem.m
@@ -1085,7 +1085,7 @@
       NSPoint *lOffsets = (NSPoint*)malloc(sizeof(NSPoint)*_nPlanes);
       u_short p;
       for (p = 0; p < _nPlanes; p++)
-         lOffsets[p] = (offsets != nil ? offsets[p] : NSMakePoint(0.0, 0.0));
+         lOffsets[p] = (offsets != NULL ? offsets[p] : NSMakePoint(0.0, 0.0));
 
       if ( _index == NSNotFound )
          // Image file
--- lynkeos.app.orig/application/Sources/FITSReader.m
+++ lynkeos.app/application/Sources/FITSReader.m
@@ -259,7 +259,7 @@
    NSBitmapImageRep* bitmap;
 
    // Create a RGBA bitmap
-   bitmap = [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:nil
+   bitmap = [[[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL
                                    pixelsWide:_width
                                    pixelsHigh:_height
                                 bitsPerSample:8
--- lynkeos.app.orig/application/Sources/FITSWriter.m
+++ lynkeos.app/application/Sources/FITSWriter.m
@@ -86,7 +86,7 @@
               metaData:(NSDictionary*)metaData
 {
    fitsfile *fits;
-   double *buf = nil;
+   double *buf = NULL;
    u_short x, y;
    double max, offset, scale, datamax, datamin;
    int err = 0;
--- lynkeos.app.orig/application/Sources/DcrawReader.m
+++ lynkeos.app/application/Sources/DcrawReader.m
@@ -248,7 +248,7 @@
 
    while ([infoTask isRunning])
    {
-      if (progressSession != nil)
+      if (progressSession != 0)
          [NSApp runModalSession:progressSession];
       [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
    }
@@ -539,7 +539,7 @@
 
          while ([_dcrawTask isRunning])
          {
-            if (progressSession != nil)
+            if (progressSession != 0)
                [NSApp runModalSession:progressSession];
             [[NSRunLoop currentRunLoop] runUntilDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
          }
@@ -555,22 +555,26 @@
 
          ppmFile = fopen( [_ppmFilePath fileSystemRepresentation], "rb" );
 
-         fgets( line, 40, ppmFile ); // First line of input "P5" or "P6"
-         if ( strcmp( "P5\n", line ) == 0 )
-            NSAssert( _numberOfPlanes == 1,
-                      @"Number of planes inconsistent after conversion" );
-         else if ( strcmp( "P6\n", line ) == 0 )
-            NSAssert( _numberOfPlanes == 3,
-                      @"Number of planes inconsistent after conversion" );
-
-         fgets( line, 40, ppmFile ); // Second line "w h"
-         NSAssert( sscanf( line, "%hu %hu", &w, &h ) == 2,
-                   @"Cannot read image size after conversion" );
-         NSAssert( w == _width && h == _height,
-                   @"Image size inconsistent after conversion" );
-         fgets( line, 40, ppmFile ); // Third line "max"
-         if ( sscanf( line, "%hu", &_dataMax ) != 1 )
-            _dataMax = 0;
+         if ( fgets( line, 40, ppmFile ) ) // First line of input "P5" or "P6"
+           {
+             if ( strcmp( "P5\n", line ) == 0 )
+               NSAssert( _numberOfPlanes == 1,
+                         @"Number of planes inconsistent after conversion" );
+             else if ( strcmp( "P6\n", line ) == 0 )
+               NSAssert( _numberOfPlanes == 3,
+                         @"Number of planes inconsistent after conversion" );
+           }
+
+         if ( fgets( line, 40, ppmFile ) ) // Second line "w h"
+           {
+             NSAssert( sscanf( line, "%hu %hu", &w, &h ) == 2,
+                       @"Cannot read image size after conversion" );
+             NSAssert( w == _width && h == _height,
+                       @"Image size inconsistent after conversion" );
+           }
+         if ( fgets( line, 40, ppmFile ) ) // Third line "max"
+           if ( sscanf( line, "%hu", &_dataMax ) != 1 )
+             _dataMax = 0;
 
          _ppmDataOffset = ftell( ppmFile );
 
@@ -633,7 +637,8 @@
          fseek( ppmFile,
                 _ppmDataOffset + sizeof(u_short)*_numberOfPlanes*((y+ys)*_width+x),
                 SEEK_SET );
-         fread( &data[ys*w*_numberOfPlanes], _numberOfPlanes*sizeof(u_short), w, ppmFile );
+         if ( fread( &data[ys*w*_numberOfPlanes], _numberOfPlanes*sizeof(u_short), w, ppmFile ) == 0 )
+           break;
       }
 
       fclose( ppmFile );
--- lynkeos.app.orig/application/ThirdPartySources/SMDoubleSlider/SMDoubleSliderCell.m
+++ lynkeos.app/application/ThirdPartySources/SMDoubleSlider/SMDoubleSliderCell.m
@@ -19,7 +19,6 @@
 #import "SMDoubleSliderCell.h"
 #import "SMDoubleSlider.h"
 
-#define GNUSTEP
 
 @interface SMDoubleSliderCell(_sm_Private)
 	// A private method to calculate the rectangle of the low knob.
--- lynkeos.app.orig/application/Sources/MyGeneralPrefs.m
+++ lynkeos.app/application/Sources/MyGeneralPrefs.m
@@ -82,7 +82,7 @@
                  includingPropertiesForKeys:
                     [NSArray arrayWithObject:NSURLTypeIdentifierKey]
                                     options:0
-                               errorHandler:nil];
+                               errorHandler:NULL];
 
       if(bundleEnum)
       {
--- lynkeos.app.orig/application/Sources/LynkeosFourierBuffer.m
+++ lynkeos.app/application/Sources/LynkeosFourierBuffer.m
@@ -118,7 +118,7 @@
                                        inDomain:NSUserDomainMask
                               appropriateForURL:nil
                                          create:YES
-                                          error:nil];
+                                          error:NULL];
    if (supportDir != nil)
    {
       wisdomFile = [supportDir URLByAppendingPathComponent:
@@ -422,20 +422,20 @@
 #endif
 
 static const ArithmeticOperation_t Mul_Spectrum
-   = {.stdProcessOneLine  = std_spectrum_mul_one_line,
-      .vectProcessOneLine = vect_spectrum_mul_one_line,
+   = {.stdProcessOneLine  = (ImageProcessOneLine_t)std_spectrum_mul_one_line,
+      .vectProcessOneLine = (ImageProcessOneLine_t)vect_spectrum_mul_one_line,
       .scalar            = NO};
 static const ArithmeticOperation_t Div_Spectrum
-   = {.stdProcessOneLine  = std_spectrum_div_one_line,
-      .vectProcessOneLine = vect_spectrum_div_one_line,
+   = {.stdProcessOneLine  = (ImageProcessOneLine_t)std_spectrum_div_one_line,
+      .vectProcessOneLine = (ImageProcessOneLine_t)vect_spectrum_div_one_line,
       .scalar            = NO};
 static const ArithmeticOperation_t MulConjugate_Spectrum
-   = {.stdProcessOneLine  = std_spectrum_mul_conjugate_one_line,
-      .vectProcessOneLine = vect_spectrum_mul_conjugate_one_line,
+   = {.stdProcessOneLine  = (ImageProcessOneLine_t)std_spectrum_mul_conjugate_one_line,
+      .vectProcessOneLine = (ImageProcessOneLine_t)vect_spectrum_mul_conjugate_one_line,
       .scalar            = NO};
 static const ArithmeticOperation_t Scale_Spectrum
-   = {.stdProcessOneLine  = std_spectrum_scale_one_line,
-      .vectProcessOneLine = vect_spectrum_scale_one_line,
+   = {.stdProcessOneLine  = (ImageProcessOneLine_t)std_spectrum_scale_one_line,
+      .vectProcessOneLine = (ImageProcessOneLine_t)vect_spectrum_scale_one_line,
       .scalar            = YES};
 
 @implementation LynkeosFourierBuffer