[med-svn] [Git][med-team/adun-app][master] Revert workarounds for -Wcast-function-type; silence the warnings instead.
Yavor Doganov (@yavor-guest)
gitlab at salsa.debian.org
Fri Oct 11 15:16:09 BST 2024
Yavor Doganov pushed to branch master at Debian Med / adun.app
Commits:
5d21c5ac by Yavor Doganov at 2024-10-11T17:15:25+03:00
Revert workarounds for -Wcast-function-type; silence the warnings instead.
- - - - -
3 changed files:
- debian/changelog
- debian/patches/gcc-warnings.patch
- debian/rules
Changes:
=====================================
debian/changelog
=====================================
@@ -1,7 +1,9 @@
adun.app (0.81-15) UNRELEASED; urgency=medium
- * debian/rules (override_dh_auto_install): Remove commands which are now
- handled by dh_gnustep. Move unrelated commands to other targets.
+ * debian/rules (DEB_OBJCFLAGS_MAINT_APPEND): Add
+ -Wno-cast-function-type with a short explanation.
+ (override_dh_auto_install): Remove commands which are now handled by
+ dh_gnustep. Move unrelated commands to other targets.
(override_dh_link): Rename as...
(execute_before_dh_link): ...and use dh_gnustep --app for adun.app.
Convert the app icon here, after /usr/share/GNUstep is created.
=====================================
debian/patches/gcc-warnings.patch
=====================================
@@ -28,12 +28,11 @@ Description: Adapt to the new GNUstep API and fix few gcc warnings.
using integer absolute value function ‘abs’ when argument is of
floating-point type ‘double’ [-Wabsolute-value]
‘mallinfo’ is deprecated [-Wdeprecated-declarations]
- cast between incompatible function types [-Wcast-function-type]
specified bound N equals destination size [-Wstringop-truncation]
Author: Yavor Doganov <yavor at gnu.org>
Bug-Debian: http://bugs.debian.org/749733
Forwarded: no
-Last-Update: 2024-08-07
+Last-Update: 2024-10-11
---
--- adun.app.orig/Kernel/AdunKernel/CoreAdditions/AdunTrajectory.m
@@ -1279,21 +1278,6 @@ Last-Update: 2024-08-07
--- adun.app.orig/Kernel/AdunKernel/Framework/AdunLinkedList.m
+++ adun.app/Kernel/AdunKernel/Framework/AdunLinkedList.m
-@@ -45,11 +45,11 @@
-
- freeElements = [NSMutableArray new];
-
-- getElement = (id (*)(id, SEL))[freeElements
-+ getElement = [freeElements
- methodForSelector:@selector(lastObject)];
-- removeElement = (void (*)(id, SEL))[freeElements
-+ removeElement = [freeElements
- methodForSelector:@selector(removeLastObject)];
-- addElement = (void (*)(id, SEL, id))[freeElements
-+ addElement = [freeElements
- methodForSelector:@selector(addObject:)];
-
- linkedList = (ListElement*)malloc(sizeof(ListElement));
@@ -119,7 +119,6 @@
- (void) _reinsertElement: (ListElement*) list_p
@@ -1935,15 +1919,6 @@ Last-Update: 2024-08-07
int gridPointIndex; //!< The index of the grid point to be used to define the atoms used in the integration.
double radialWeight, angularWeight;
double holder,valueOne, valueTwo; //< For holding precalculated values
-@@ -345,7 +342,7 @@
- absPoint.vector[2] = position[2] + integrationPoint.vector[2];
-
- //Find the nearest grid point to this point
-- gridPointIndex = getIndex(soluteGrid, gridSelector, &absPoint);
-+ gridPointIndex = (int)(intptr_t)(getIndex)(soluteGrid, gridSelector, &absPoint);
-
- //Get the value of the volume function
- //If no atoms overlap the point the volume function is 0.
@@ -399,7 +396,7 @@
- (void) _calculateBornRadiiAndCFATerms
@@ -1963,15 +1938,6 @@ Last-Update: 2024-08-07
double radialWeight, angularWeight;
double volumeExclusionValue, atomSASA, radius;
double* position, *weightsBuffer, *pointsBuffer;
-@@ -475,7 +473,7 @@
- absPoint.vector[1] = position[1] + integrationPoint.vector[1];
- absPoint.vector[2] = position[2] + integrationPoint.vector[2];
-
-- gridPointIndex = getIndex(soluteGrid, gridSelector, &absPoint);
-+ gridPointIndex = (int)(intptr_t)(getIndex)(soluteGrid, gridSelector, &absPoint);
-
- //FIMXE: Is this necessary?
- if(gridPointIndex == -1)
@@ -517,7 +515,7 @@
- (void) _calculateSASA
@@ -2002,15 +1968,6 @@ Last-Update: 2024-08-07
calculatedGradients.length = 0;
interactingAtoms = calloc(numberOfAtoms, sizeof(bool));
-@@ -649,7 +648,7 @@
- absPoint.vector[2] = mainAtomPosition[2] + integrationPoint.vector[2];
-
- //Find the nearest grid point to this point
-- gridPointIndex = getIndex(soluteGrid, gridSelector, &absPoint);
-+ gridPointIndex = (int)(intptr_t)(getIndex)(soluteGrid, gridSelector, &absPoint);
-
- //Get the derivatives.
- //All derivatives depend on the value of the volume exclusion function (VEF) at the
@@ -845,7 +844,7 @@
double angularWeight, double radialWeight, double f3, AdMatrix* gradients)
{
@@ -2058,13 +2015,7 @@ Last-Update: 2024-08-07
double* atomPosition, *pointPosition;
double **cMatrix, **gMatrix;
NSArray* divisions;
-@@ -434,12 +435,12 @@
-
- //Create function pointer to indexOfGridPointNearestToPoint:
- gridSelector = @selector(indexOfGridPointNearestToPoint:);
-- getIndex = (int (*)(id, SEL, Vector3D*))[soluteGrid methodForSelector: gridSelector];
-+ getIndex = [soluteGrid methodForSelector: gridSelector];
- }
+@@ -439,7 +440,7 @@
- (void) _initLookupTableVariables
{
@@ -2185,7 +2136,7 @@ Last-Update: 2024-08-07
+ uintptr_t* inter;
uint_fast8_t *bin;
- int (*interact)(id, SEL, int*, int, NSRangePointer);
-+ IMP interact;
++ NSUInteger (*interact)(id, SEL, NSUInteger*, NSUInteger, NSRangePointer);
ListElement* el_p;
IntArrayStruct *checkInteractions, *cellContentsBuffer;
IntArrayStruct interactionBuffer, neighbourCells, nocheckBuffer;
@@ -2214,10 +2165,10 @@ Last-Update: 2024-08-07
//load this atoms interactions into a buffer
- interact = (int (*)(id, SEL, int*, int, NSRangePointer))[interaction methodForSelector:
-+ interact = [interaction methodForSelector:
++ interact = (NSUInteger (*)(id, SEL, NSUInteger*, NSUInteger, NSRangePointer))[interaction methodForSelector:
@selector(getIndexes:maxCount:inIndexRange:)];
- interactionBuffer.length = interact(interaction,
-+ interactionBuffer.length = (NSUInteger)(interact)(interaction,
++ interactionBuffer.length = interact(interaction,
@selector(getIndexes:maxCount:inIndexRange:),
interactionBuffer.array,
coordinates->no_rows,
@@ -2272,8 +2223,8 @@ Last-Update: 2024-08-07
Vector3D separation;
- BOOL (*interact)(id, SEL, int);
- id (*fetch)(id, SEL, int);
-+ IMP interact;
-+ IMP fetch;
++ BOOL (*interact)(id, SEL, NSUInteger);
++ id (*fetch)(id, SEL, NSUInteger);
SEL selector, selector2;
//Update does nothing if the createList hasnt
@@ -2298,29 +2249,20 @@ Last-Update: 2024-08-07
//we cache this method call since will be using it alot
- fetch = (id (*)(id, SEL, int))[interactions
-+ fetch = [interactions
++ fetch = (id (*)(id, SEL, NSUInteger))[interactions
methodForSelector: @selector(objectAtIndex:)];
/*
-@@ -668,7 +668,7 @@
- holder = cutoff + diagonal;
- for(k=0; k< numberOfInteractionSets; k++)
- {
-- interaction = fetch(interactions, selector2, k);
-+ interaction = (id)(fetch)(interactions, selector2, k);
- if([interaction count] == 0)
- {
- removed = &removedInteractions[k];
@@ -677,7 +677,7 @@
}
currentInteractions.length = 0;
- interact = (BOOL (*)(id, SEL, int))[interaction methodForSelector: selector];
-+ interact = [interaction methodForSelector: selector];
++ interact = (BOOL (*)(id, SEL, NSUInteger))[interaction methodForSelector: selector];
/*
Load the possible interactions into a buffer called currentInteractions.
-@@ -752,12 +752,12 @@
+@@ -752,7 +752,7 @@
*/
newInteractions.length = 0;
@@ -2329,12 +2271,6 @@ Last-Update: 2024-08-07
for(i=0; i< currentInteractions.length; i++)
{
atomTwo = currentInteractions.array[i];
- if(cellBin[atomTwo] != 1)
-- if(interact(interaction, selector, atomTwo) == YES)
-+ if((BOOL)(uintptr_t)(interact)(interaction, selector, atomTwo) == YES)
- if([self _checkInteractionBetweenAtomOne: k atomTwo: atomTwo])
- {
- newInteractions.array[newInteractions.length] = atomTwo;
@@ -792,7 +792,7 @@
newInteractions.length++;
}
@@ -5432,21 +5368,6 @@ Last-Update: 2024-08-07
int numberOccludedMolecules; //!< the number of solvent molecules hidden by the solute
int atomsPerMolecule; //!< the number of atoms in a solvent molecule
AdMutableDataMatrix* elementProperties;
---- adun.app.orig/Kernel/AdunKernel/Headers/AdunKernel/AdunLinkedList.h
-+++ adun.app/Kernel/AdunKernel/Headers/AdunKernel/AdunLinkedList.h
-@@ -62,9 +62,9 @@
- ListElement* blocks[50]; //array containing the current blocks
- ListElement* current_block; //the current block
- NSMutableArray* freeElements; //array of pointers to freed elements
-- id (*getElement)(id, SEL);
-- void (*removeElement)(id, SEL);
-- void (*addElement)(id, SEL, id);
-+ IMP getElement;
-+ IMP removeElement;
-+ IMP addElement;
- NSZone* listZone;
- }
- /**
--- adun.app.orig/Kernel/AdunKernel/Framework/AdunGRFNonbondedTerm.m
+++ adun.app/Kernel/AdunKernel/Framework/AdunGRFNonbondedTerm.m
@@ -646,7 +646,7 @@
@@ -5518,13 +5439,7 @@ Last-Update: 2024-08-07
double coefficentOne; //!< Empirical coefficent a_0
double coefficentTwo; //!< Empriccal coefficent a_1
double smoothingLength; //!< The smoothing length
-@@ -95,13 +95,13 @@
- AdGrid* soluteGrid; //!< A cartesian grid in a volume defined by the solute vdw radius + delta R.
- AdCuboidBox* cavity; //!< The cavity object defining the volume where the grid exists.
- uint_fast8_t *overlapBuffer; //!< Used to check if the grid needs to be rebuilt
-- int (*getIndex)(id,SEL,Vector3D*);
-+ IMP getIndex;
- SEL gridSelector;
+@@ -100,8 +100,8 @@
NSZone* lookupZone;
//Integration Points
=====================================
debian/rules
=====================================
@@ -16,6 +16,10 @@ export DEB_CFLAGS_MAINT_APPEND := -fgnu89-inline
# macros are perfectly fine for Debian where a capable preprocessor is
# used on all architectures.
export DEB_OBJCFLAGS_MAINT_APPEND := -Wno-expansion-to-defined
+# Silence warnings for casts between incompatible function types,
+# enabled by -Wextra. It is perfectly fine to cast IMP to another
+# function provided the prototypes match (which upstream code does).
+DEB_OBJCFLAGS_MAINT_APPEND += -Wno-cast-function-type
# All of the package's libraries/frameworks have incomplete APIs with
# stubs or incomplete functions/methods which cause a lot of
# unused-parameter compiler warnings. Rather than adding
View it on GitLab: https://salsa.debian.org/med-team/adun-app/-/commit/5d21c5ac2f0ff80ca606523fa182e3c51c27baa2
--
View it on GitLab: https://salsa.debian.org/med-team/adun-app/-/commit/5d21c5ac2f0ff80ca606523fa182e3c51c27baa2
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20241011/b7b7b3b7/attachment-0001.htm>
More information about the debian-med-commit
mailing list