Skip to content

Commit

Permalink
Indidriver/refactoring (indilib#1313)
Browse files Browse the repository at this point in the history
  • Loading branch information
pawel-soja authored Jan 11, 2021
1 parent 978290d commit c714f9c
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 271 deletions.
6 changes: 3 additions & 3 deletions eventloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ int addCallback(int fd, CBF *fp, void *ud)
break;
if (cp == &cback[ncback])
{
cback = cback ? (CB *)realloc(cback, (ncback + 1) * sizeof(CB)) : (CB *)malloc(sizeof(CB));
cback = realloc(cback, (ncback + 1) * sizeof(CB));
cp = &cback[ncback++];
}

Expand Down Expand Up @@ -212,7 +212,7 @@ int addTimer(int ms, TCF *fp, void *ud)
gettimeofday(&t, NULL);

/* add one entry */
timef = timef ? (TF *)realloc(timef, (ntimef + 1) * sizeof(TF)) : (TF *)malloc(sizeof(TF));
timef = (TF *)realloc(timef, (ntimef + 1) * sizeof(TF));
tp = &timef[ntimef++];

/* init new entry */
Expand Down Expand Up @@ -274,7 +274,7 @@ int addWorkProc(WPF *fp, void *ud)
break;
if (wp == &wproc[nwproc])
{
wproc = wproc ? (WP *)realloc(wproc, (nwproc + 1) * sizeof(WP)) : (WP *)malloc(sizeof(WP));
wproc = (WP *)realloc(wproc, (nwproc + 1) * sizeof(WP));
wp = &wproc[nwproc++];
}

Expand Down
Loading

0 comments on commit c714f9c

Please sign in to comment.