mirror of
https://github.com/gryf/wmamixer.git
synced 2025-12-17 11:30:21 +01:00
Fix format-truncation warnings.
This commit is contained in:
@@ -302,14 +302,14 @@ void Mixer_set_selem_props(struct Selem *selem, const char *name) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Selem_set_name(struct Selem *selem, const char *name, short int *count) {
|
void Selem_set_name(struct Selem *selem, const char *name, short unsigned int *count) {
|
||||||
char new_name[5], buf[5];
|
char new_name[5], buf[4];
|
||||||
|
|
||||||
if (*count > 10) {
|
if (*count > 10) {
|
||||||
snprintf(new_name, sizeof(new_name), "%s", name);
|
snprintf(new_name, sizeof(new_name), "%s", name);
|
||||||
} else {
|
} else {
|
||||||
snprintf(buf, sizeof(buf) - 1, "%s", name);
|
snprintf(buf, sizeof(buf), "%s", name);
|
||||||
snprintf(new_name, sizeof(new_name), "%s%d", buf, *count);
|
snprintf(new_name, sizeof(new_name), "%s%hu", buf, *count);
|
||||||
}
|
}
|
||||||
|
|
||||||
selem->name = strdup(new_name);
|
selem->name = strdup(new_name);
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
#define CLASS "Wmamixer"
|
#define CLASS "Wmamixer"
|
||||||
|
|
||||||
|
|
||||||
#define VERSION "1.0"
|
#define VERSION "1.1"
|
||||||
|
|
||||||
// User defines - custom
|
// User defines - custom
|
||||||
#define BACKCOLOR "#202020"
|
#define BACKCOLOR "#202020"
|
||||||
@@ -142,7 +142,7 @@ typedef struct {
|
|||||||
} slideCaptureMono;
|
} slideCaptureMono;
|
||||||
|
|
||||||
struct NamesCount {
|
struct NamesCount {
|
||||||
short int pcm, line, lineb, mic, micb, capt, vol, aux;
|
short unsigned int pcm, line, lineb, mic, micb, capt, vol, aux;
|
||||||
} namesCount = {1, 1, 1, 1, 1, 1, 1, 1};
|
} namesCount = {1, 1, 1, 1, 1, 1, 1, 1};
|
||||||
|
|
||||||
struct Selem *selems[32] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
struct Selem *selems[32] = {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
|
||||||
@@ -194,7 +194,7 @@ void Mixer_set_right(int current, int value);
|
|||||||
void Mixer_set_limits(snd_mixer_elem_t *elem, struct Selem *selem);
|
void Mixer_set_limits(snd_mixer_elem_t *elem, struct Selem *selem);
|
||||||
void Mixer_set_volume(int current, int channelIndex, int value);
|
void Mixer_set_volume(int current, int channelIndex, int value);
|
||||||
|
|
||||||
void Selem_set_name(struct Selem *selem, const char *name, short int *count);
|
void Selem_set_name(struct Selem *selem, const char *name, short unsigned int *count);
|
||||||
void Selem_destroy();
|
void Selem_destroy();
|
||||||
|
|
||||||
#endif // WMAMIXER_H_
|
#endif // WMAMIXER_H_
|
||||||
|
|||||||
Reference in New Issue
Block a user