POV-Ray : Newsgroups : povray.binaries.images : HSL HSV colors.inc fopah : Re: HSL HSV colors.inc fopah Server Time
28 Apr 2024 08:43:09 EDT (-0400)
  Re: HSL HSV colors.inc fopah  
From: jr
Date: 31 Dec 2019 05:20:00
Message: <web.5e0b1ff7ffbdd818c662f470@news.povray.org>
hi,

"Melody" <nomail@nomail> wrote:
> "Melody" <nomail@nomail> wrote:
> > libpthreadGC2.a pthreadGC2.dll
> >
> > #include <pthread.h>
> > #include <unistd.h>
>
> C:\mirc614\irc\timer.h|32|warning: control reaches end of non-void function
> [-Wreturn-type]
>
> whats the fix for that warning? for this "non-void function"
> ??? compiler wont allow returning anything ??
>
> void * twait(int secs)
> {
>   /// do something here
> }
>
> newthread launcher from a dll - follow up.
>
> int timer1(HWND mWnd, int secs, void * func)
> {
>   pthread_t thread; int err;
>   err = pthread_create(&thread, NULL, func, (void *)secs);
>   if (err) return 1;
>   return 0;
> }
>
> timer1(mWnd,0,twait);
> working now,
> but is 4th parameter done the right way? what about &secs ??

am fairly sure that should be 'void twait(int);', and I'd keep "do something
here" to just setting some (global) flag.

<https://www.gnu.org/software/libc/manual/html_node/Basic-Signal-Handling.html>
(specific to that library but the same principles apply)

and re 4th argument, you're converting the number of seconds to a pointer
(value), did you mean 'pthread_create(&thread, NULL, func, &secs)'?  no need
(usually) to explicitly cast to '(void *)'.


regards, jr.


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.