Remove some redundant casts.
This commit is contained in:
parent
4f59fc9967
commit
8585ec930f
7 changed files with 13 additions and 14 deletions
|
@ -105,8 +105,8 @@ turn(void)
|
|||
if (msgfilepath == downfil)
|
||||
pr("Logins disabled.\n");
|
||||
|
||||
if ((fwrite((void *)&tgm, sizeof(tgm), 1, fptr) != 1) ||
|
||||
(fwrite((void *)buf, tgm.tel_length, 1, fptr) != 1)) {
|
||||
if ((fwrite(&tgm, sizeof(tgm), 1, fptr) != 1) ||
|
||||
(fwrite(buf, tgm.tel_length, 1, fptr) != 1)) {
|
||||
fclose(fptr);
|
||||
pr("Something went wrong writing the message file.\n");
|
||||
logerror("Could not properly write message file (%s).\n",
|
||||
|
|
|
@ -481,8 +481,7 @@ empth_create(int prio, void (*entry)(void *), int size, int flags,
|
|||
if (size < loc_MIN_THREAD_STACK)
|
||||
size = loc_MIN_THREAD_STACK;
|
||||
|
||||
pThread->ulThreadID = _beginthread(empth_threadMain, size,
|
||||
(void *)pThread);
|
||||
pThread->ulThreadID = _beginthread(empth_threadMain, size, pThread);
|
||||
if (pThread->ulThreadID == -1) {
|
||||
logerror("can not create thread: %s (%s): %s", name, desc,
|
||||
strerror(errno));
|
||||
|
|
|
@ -215,9 +215,9 @@ empth_create(int prio, void (*entry)(void *), int size, int flags,
|
|||
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
|
||||
|
||||
#ifdef _DECTHREADS_
|
||||
eno = pthread_create(&t, attr, empth_start, (void *)ctx) ? errno : 0;
|
||||
eno = pthread_create(&t, attr, empth_start, ctx) ? errno : 0;
|
||||
#else
|
||||
eno = pthread_create(&t, &attr, empth_start, (void *)ctx);
|
||||
eno = pthread_create(&t, &attr, empth_start, ctx);
|
||||
#endif
|
||||
if (eno) {
|
||||
logerror("can not create thread: %s (%s): %s", name, desc,
|
||||
|
@ -246,8 +246,8 @@ empth_setctx(void *ct)
|
|||
ctx_ptr = (empth_t *)pthread_getspecific(ctx_key);
|
||||
#endif
|
||||
ctx_ptr->ud = ct;
|
||||
*udata = ((empth_t *)ctx_ptr)->ud;
|
||||
pthread_setspecific(ctx_key, (void *)ctx_ptr);
|
||||
*udata = ctx_ptr->ud;
|
||||
pthread_setspecific(ctx_key, ctx_ptr);
|
||||
empth_status("context saved");
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -160,7 +160,7 @@ gamedown(void)
|
|||
return 0;
|
||||
if ((down_fp = fopen(downfil, "rb")) == NULL)
|
||||
return 0;
|
||||
if (fread((void *)&tgm, sizeof(tgm), 1, down_fp) != 1) {
|
||||
if (fread(&tgm, sizeof(tgm), 1, down_fp) != 1) {
|
||||
logerror("bad header on login message (downfil)");
|
||||
fclose(down_fp);
|
||||
return 1;
|
||||
|
|
|
@ -358,7 +358,7 @@ show_motd(void)
|
|||
return RET_SYS;
|
||||
}
|
||||
}
|
||||
if (fread((void *)&tgm, sizeof(tgm), 1, motd_fp) != 1) {
|
||||
if (fread(&tgm, sizeof(tgm), 1, motd_fp) != 1) {
|
||||
logerror("bad header on login message (motdfil)");
|
||||
fclose(motd_fp);
|
||||
return RET_FAIL;
|
||||
|
|
|
@ -114,7 +114,7 @@ copy_and_expire(FILE *annfp, FILE *tmpfp, char *tmp_filename,
|
|||
int saved = 0;
|
||||
int first = 1;
|
||||
|
||||
while (fread((void *)&tgm, sizeof(tgm), 1, annfp) == 1) {
|
||||
while (fread(&tgm, sizeof(tgm), 1, annfp) == 1) {
|
||||
writeit = 1;
|
||||
if (tgm.tel_length < 0 || tgm.tel_length > MAXTELSIZE) {
|
||||
logerror("bad telegram file header (length=%ld)",
|
||||
|
@ -136,7 +136,7 @@ copy_and_expire(FILE *annfp, FILE *tmpfp, char *tmp_filename,
|
|||
writeit = 0;
|
||||
|
||||
if (writeit) {
|
||||
if (fwrite((void *)&tgm, sizeof(tgm), 1, tmpfp) != 1) {
|
||||
if (fwrite(&tgm, sizeof(tgm), 1, tmpfp) != 1) {
|
||||
logerror("error writing header to temporary "
|
||||
"telegram file %s", tmp_filename);
|
||||
return 0;
|
||||
|
|
|
@ -1115,8 +1115,8 @@ write_file(void)
|
|||
{
|
||||
int n;
|
||||
|
||||
if ((n = fwrite((void *)sectsbuf, sizeof(struct sctstr),
|
||||
YSIZE * XSIZE, sect_fptr)) <= 0) {
|
||||
n = fwrite(sectsbuf, sizeof(struct sctstr), YSIZE * XSIZE, sect_fptr);
|
||||
if (n <= 0) {
|
||||
perror(empfile[EF_SECTOR].file);
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue