]> git.pond.sub.org Git - empserver/commitdiff
Remove some redundant casts.
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 12 Jun 2005 08:17:13 +0000 (08:17 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 12 Jun 2005 08:17:13 +0000 (08:17 +0000)
src/lib/commands/turn.c
src/lib/empthread/ntthread.c
src/lib/empthread/pthread.c
src/lib/player/empdis.c
src/lib/player/player.c
src/lib/update/anno.c
src/util/fairland.c

index 6a365effb45f727d7ca0880a824e98cb3cfb1147..1c35ef531efac93113a51bfc0a42c05b1a4b3e2b 100644 (file)
@@ -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",
index 5d87ed73ed76e604283fa950c359e5f2e7d68ca4..529cbf8655063e58cd195db168bfbe1767be1541 100644 (file)
@@ -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));
index 6379d5b08e5f345aabcca613f3184cf1c00d98f6..a01c1b5ebdb1c4b57e05002813a1113bcce68c1d 100644 (file)
@@ -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
index 831710a93d30ac2502a3b21fa603a5c024a07d02..56a75163712384589cdc29422c40f927e3b73b09 100644 (file)
@@ -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;
index ae4447ab18cbcd78293fc59a7dcac2dbcf3bbd34..519324220256853288162b58b25dbdc595fa210c 100644 (file)
@@ -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;
index 46b0a02c330f46a0d6f007a6b56caa21337fcb0c..8895ef4b8a9a683e233803f668ab816c54e4f682 100644 (file)
@@ -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;
index 088aca3c901b5242e4b7cf11b6792f89dd361c57..b6f0d7a13057952a3fc0c54535ec92fc030c4de0 100644 (file)
@@ -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;
     }