Browse Source

fix compiler warnings

Signed-off-by: Karel Zak <kzak@redhat.com>
pull/1241/head
Karel Zak 2 years ago
parent
commit
31862cde0a
  1. 3
      libuuid/src/unparse.c
  2. 4
      misc-utils/cal.c
  3. 12
      sys-utils/ipcutils.c
  4. 16
      term-utils/agetty.c

3
libuuid/src/unparse.c

@ -42,8 +42,9 @@ static char const hexdigits_upper[16] = "0123456789ABCDEF";
static void uuid_fmt(const uuid_t uuid, char *buf, char const fmt[restrict])
{
char *p = buf;
int i;
for (int i = 0; i < 16; i++) {
for (i = 0; i < 16; i++) {
if (i == 4 || i == 6 || i == 8 || i == 10) {
*p++ = '-';
}

4
misc-utils/cal.c

@ -668,7 +668,9 @@ static int monthname_to_number(struct cal_control *ctl, const char *name)
static void weekdays_init(struct cal_control *ctl)
{
size_t wd;
for (int i = 0; i < DAYS_IN_WEEK; i++) {
int i;
for (i = 0; i < DAYS_IN_WEEK; i++) {
wd = (i + ctl->weekstart) % DAYS_IN_WEEK;
ctl->weekdays[i] = nl_langinfo(ABDAY_1 + wd);
}

12
sys-utils/ipcutils.c

@ -100,7 +100,7 @@ int ipc_shm_get_limits(struct ipc_limits *lim)
int ipc_shm_get_info(int id, struct shm_data **shmds)
{
FILE *f;
int i = 0, maxid;
int i = 0, maxid, j;
char buf[BUFSIZ];
struct shm_data *p;
struct shmid_ds dummy;
@ -164,7 +164,7 @@ int ipc_shm_get_info(int id, struct shm_data **shmds)
shm_fallback:
maxid = shmctl(0, SHM_INFO, &dummy);
for (int j = 0; j <= maxid; j++) {
for (j = 0; j <= maxid; j++) {
int shmid;
struct shmid_ds shmseg;
struct ipc_perm *ipcp = &shmseg.shm_perm;
@ -248,7 +248,7 @@ static void get_sem_elements(struct sem_data *p)
int ipc_sem_get_info(int id, struct sem_data **semds)
{
FILE *f;
int i = 0, maxid;
int i = 0, maxid, j;
struct sem_data *p;
struct seminfo dummy;
union semun arg;
@ -304,7 +304,7 @@ sem_fallback:
arg.array = (ushort *) (void *)&dummy;
maxid = semctl(0, 0, SEM_INFO, arg);
for (int j = 0; j <= maxid; j++) {
for (j = 0; j <= maxid; j++) {
int semid;
struct semid_ds semseg;
struct ipc_perm *ipcp = &semseg.sem_perm;
@ -356,7 +356,7 @@ void ipc_sem_free_info(struct sem_data *semds)
int ipc_msg_get_info(int id, struct msg_data **msgds)
{
FILE *f;
int i = 0, maxid;
int i = 0, maxid, j;
struct msg_data *p;
struct msqid_ds dummy;
struct msqid_ds msgseg;
@ -416,7 +416,7 @@ int ipc_msg_get_info(int id, struct msg_data **msgds)
msg_fallback:
maxid = msgctl(0, MSG_INFO, &dummy);
for (int j = 0; j <= maxid; j++) {
for (j = 0; j <= maxid; j++) {
int msgid;
struct ipc_perm *ipcp = &msgseg.msg_perm;

16
term-utils/agetty.c

@ -390,13 +390,17 @@ int main(int argc, char **argv)
sigaction(SIGINT, &sa, &sa_int);
#ifdef DEBUGGING
dbf = fopen(DEBUG_OUTPUT, "w");
for (int i = 1; i < argc; i++) {
if (i > 1)
debug(" ");
debug(argv[i]);
{
int i;
dbf = fopen(DEBUG_OUTPUT, "w");
for (i = 1; i < argc; i++) {
if (i > 1)
debug(" ");
debug(argv[i]);
}
debug("\n");
}
debug("\n");
#endif /* DEBUGGING */
/* Parse command-line arguments. */

Loading…
Cancel
Save