Skip to content

Commit 929e2e8

Browse files
authored
Fix MSVC warning C4018 signed/unsigned mismatch (#821)
See #810
1 parent e951915 commit 929e2e8

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ if(PA_WARNINGS_ARE_ERRORS)
2222
# "Grandfathered" warnings that existed before we started enforcement.
2323
# Do *NOT* add warnings to this list. Instead, fix your code so that it doesn't produce the warning.
2424
# TODO: fix the offending code so that we don't have to exclude specific warnings anymore.
25-
/wd4018 # W3 signed/unsigned mismatch
2625
/wd4244 # W2 conversion possible loss of data
2726
/wd4267 # W3 conversion possible loss of data
2827
/wd4996 # W3 unsafe/deprecated

qa/loopback/src/paqa.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ typedef struct LoopbackContext_s
120120
volatile int minInputOutputDelta;
121121
volatile int maxInputOutputDelta;
122122

123-
int minFramesPerBuffer;
124-
int maxFramesPerBuffer;
123+
unsigned long minFramesPerBuffer;
124+
unsigned long maxFramesPerBuffer;
125125
int primingCount;
126126
TestParameters *test;
127127
volatile int done;
@@ -849,7 +849,7 @@ static int PaQa_SingleLoopBackTest( UserOptions *userOptions, TestParameters *te
849849
{
850850
double latencyMSec;
851851

852-
printf( "%4d-%4d | ",
852+
printf( "%4lu-%4lu | ",
853853
loopbackContext.minFramesPerBuffer,
854854
loopbackContext.maxFramesPerBuffer
855855
);

qa/paqa_devs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static int QaCallback( const void *inputData,
225225
void *userData )
226226
{
227227
unsigned long frameIndex;
228-
unsigned long channelIndex;
228+
int channelIndex;
229229
float sample;
230230
PaQaData *data = (PaQaData *) userData;
231231
const PaQaTestParameters *parameters = data->parameters;

qa/paqa_latency.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ typedef struct
6161
int left_phase;
6262
int right_phase;
6363
char message[20];
64-
int minFramesPerBuffer;
65-
int maxFramesPerBuffer;
64+
unsigned long minFramesPerBuffer;
65+
unsigned long maxFramesPerBuffer;
6666
int callbackCount;
6767
PaTime minDeltaDacTime;
6868
PaTime maxDeltaDacTime;
@@ -170,8 +170,8 @@ PaError paqaCheckLatency( PaStreamParameters *outputParamsPtr,
170170
printf("Play for %d seconds.\n", NUM_SECONDS );
171171
Pa_Sleep( NUM_SECONDS * 1000 );
172172

173-
printf(" minFramesPerBuffer = %4d\n", dataPtr->minFramesPerBuffer );
174-
printf(" maxFramesPerBuffer = %4d\n", dataPtr->maxFramesPerBuffer );
173+
printf(" minFramesPerBuffer = %4lu\n", dataPtr->minFramesPerBuffer );
174+
printf(" maxFramesPerBuffer = %4lu\n", dataPtr->maxFramesPerBuffer );
175175
printf(" minDeltaDacTime = %f\n", dataPtr->minDeltaDacTime );
176176
printf(" maxDeltaDacTime = %f\n", dataPtr->maxDeltaDacTime );
177177

src/hostapi/jack/pa_jack.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ static PaError BuildDeviceList( PaJackHostApiRepresentation *jackApi )
507507
// Add 1 for null terminator.
508508
size_t device_name_regex_escaped_size = jack_client_name_size() * 2 + 1;
509509
size_t port_regex_size = device_name_regex_escaped_size + strlen(port_regex_suffix);
510-
int port_index, client_index, i;
510+
unsigned long port_index, client_index, i;
511511
double globalSampleRate;
512512
regex_t port_regex;
513513
unsigned long numClients = 0, numPorts = 0;

test/patest_latency.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ static int patestCallback( const void *inputBuffer, void *outputBuffer,
9393
{
9494
paTestData *data = (paTestData*)userData;
9595
float *out = (float*)outputBuffer;
96-
int i;
96+
unsigned long i;
9797

9898
(void) inputBuffer; /* Prevent unused variable warning. */
9999

0 commit comments

Comments
 (0)