Skip to content

Commit

Permalink
Merge branch 'symmetry-msvc-warnings' into 'v80-bugfix'
Browse files Browse the repository at this point in the history
reduce MSVC warnings on symmetry code

See merge request integer/scip!3246
  • Loading branch information
svigerske committed Nov 20, 2023
2 parents bbc8cb5 + 08ddf67 commit 6129793
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/scip/prop_symmetry.c
Original file line number Diff line number Diff line change
Expand Up @@ -3957,8 +3957,9 @@ SCIP_RETCODE addWeakSBCsSubgroup(
{
/* add element from lexorder to hashmap.
* Use insert, as duplicate entries in lexorder is not permitted. */
assert( ! SCIPhashmapExists(varsinlexorder, (void*) (long) (*lexorder)[k]) ); /* Use int as pointer */
SCIP_CALL( SCIPhashmapInsertInt(varsinlexorder, (void*) (long) (*lexorder)[k], k) );
assert((*lexorder)[k] >= 0);
assert( ! SCIPhashmapExists(varsinlexorder, (void*) (size_t) (*lexorder)[k]) ); /* Use int as pointer */
SCIP_CALL( SCIPhashmapInsertInt(varsinlexorder, (void*) (size_t) (*lexorder)[k], k) );
}
}

Expand All @@ -3979,6 +3980,7 @@ SCIP_RETCODE addWeakSBCsSubgroup(
graphcomp = chosencomppercolor[j];
graphcompsize = graphcompbegins[graphcomp+1] - graphcompbegins[graphcomp];
varidx = firstvaridxpercolor[j];
assert(varidx >= 0);

/* if the first variable was already contained in another orbit or if there are no variables left anyway, skip the
* component */
Expand All @@ -3987,7 +3989,7 @@ SCIP_RETCODE addWeakSBCsSubgroup(

/* If varidx is in lexorder, then it must be the first entry of lexorder. */
if ( varsinlexorder != NULL
&& SCIPhashmapExists(varsinlexorder, (void*) (long) varidx)
&& SCIPhashmapExists(varsinlexorder, (void*) (size_t) varidx)
&& lexorder != NULL && *lexorder != NULL && *maxnvarsorder > 0 && *nvarsorder > 0
&& (*lexorder)[0] != varidx )
continue;
Expand Down Expand Up @@ -4077,6 +4079,7 @@ SCIP_RETCODE addWeakSBCsSubgroup(
int varidx;

varidx = orbit[activeorb][0];
assert(varidx >= 0);

if ( *maxnvarsorder == 0 )
{
Expand All @@ -4097,13 +4100,13 @@ SCIP_RETCODE addWeakSBCsSubgroup(
if ( varidx == (*lexorder)[0] )
{
/* lexorder is already ok!! */
assert( SCIPhashmapExists(varsinlexorder, (void*) (long) varidx) );
assert( SCIPhashmapExists(varsinlexorder, (void*) (size_t) varidx) );
}
else
{
/* Then varidx must not be in the lexorder,
* We must add it at the front of the array, and maintain the current order. */
assert( ! SCIPhashmapExists(varsinlexorder, (void*) (long) varidx) );
assert( ! SCIPhashmapExists(varsinlexorder, (void*) (size_t) varidx) );

++(*maxnvarsorder);
++(*nvarsorder);
Expand Down
1 change: 1 addition & 0 deletions src/symmetry/compute_symmetry_sassy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4189) // local variable is initialized but not referenced
# pragma warning(disable: 4267) // conversion of size_t to int (at sassy/preprocessor.h:2897)
# pragma warning(disable: 4388) // compare signed and unsigned expression
# pragma warning(disable: 4456) // shadowed variable
# pragma warning(disable: 4430) // missing type specifier
Expand Down

0 comments on commit 6129793

Please sign in to comment.