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",
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));
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,
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
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;
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;
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)",
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;
{
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;
}