Skip to content

Commit

Permalink
More changes to avoid compiler warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbdannenberg committed Mar 26, 2024
1 parent dba8357 commit 4b23629
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions pm_common/portmidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ PmError pm_add_device(char *interf, const char *name, int is_input,
if (!d->name) {
return pmInsufficientMemory;
}
#ifdef WIN32
#if defined(WIN32) && !defined(_WIN32)
#pragma warning(suppress: 4996) // don't use suggested strncpy_s
#endif
strcpy(d->name, name);
Expand Down Expand Up @@ -505,7 +505,7 @@ PMEXPORT void Pm_GetHostErrorText(char * msg, unsigned int len)
assert(msg);
assert(len > 0);
if (pm_hosterror) {
#ifdef WIN32
#if defined(WIN32) && !defined(_WIN32)
#pragma warning(suppress: 4996) // don't use suggested strncpy_s
#endif
strncpy(msg, (char *) pm_hosterror_text, len);
Expand Down Expand Up @@ -867,7 +867,7 @@ PMEXPORT PmError Pm_WriteSysEx(PortMidiStream *stream, PmTimestamp when,
*/
if (shift != 0) bufx++; /* add partial message to buffer len */
if (bufx) { /* bufx is number of PmEvents to send from buffer */
PmError err = Pm_Write(stream, buffer, bufx);
err = Pm_Write(stream, buffer, bufx);
if (err) return err;
}
return pmNoError;
Expand Down
10 changes: 5 additions & 5 deletions pm_linux/pmlinuxalsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static PmError alsa_out_open(PmInternal *midi, void *driverInfo)
pm_descriptors[id].pub.is_virtual);
snd_seq_port_info_t *pinfo;
int err = 0;
int queue_used = 0;
int using_the_queue = 0;

if (!ainfo) return pmInsufficientMemory;
midi->api_info = ainfo;
Expand Down Expand Up @@ -223,7 +223,7 @@ static PmError alsa_out_open(PmInternal *midi, void *driverInfo)
if (midi->latency > 0) { /* must delay output using a queue */
err = alsa_use_queue();
if (err < 0) goto free_parser;
queue_used++;
using_the_queue++;
}

if (!ainfo->is_virtual) {
Expand All @@ -237,7 +237,7 @@ static PmError alsa_out_open(PmInternal *midi, void *driverInfo)
return pmNoError;

unuse_queue:
if (queue_used > 0) /* only for latency>0 case */
if (using_the_queue > 0) /* only for latency>0 case */
alsa_unuse_queue();
free_parser:
snd_midi_event_free(ainfo->parser);
Expand Down Expand Up @@ -750,9 +750,9 @@ static PmError alsa_poll(PmInternal *midi)
int i;
for (i = 0; i < pm_descriptor_len; i++) {
if (pm_descriptors[i].pub.input) {
PmInternal *midi = pm_descriptors[i].pm_internal;
PmInternal *midi_i = pm_descriptors[i].pm_internal;
/* careful, device may not be open! */
if (midi) Pm_SetOverflow(midi->queue);
if (midi_i) Pm_SetOverflow(midi_i->queue);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion pm_mac/pmmacosxcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ static void read_callback(const MIDIPacketList *newPackets, PmInternal *midi)
MIDIPacket *packet;
unsigned int packetIndex;
uint32_t now;
unsigned int status;
/* Retrieve the context for this connection */
coremidi_info_type info = (coremidi_info_type) midi->api_info;
assert(info);
Expand Down

0 comments on commit 4b23629

Please sign in to comment.