RE: Porting SimpleHTTPServer to CW/C++
RE: Porting SimpleHTTPServer to CW/C++
- Subject: RE: Porting SimpleHTTPServer to CW/C++
- From: "Pietrzak, Bryan" <email@hidden>
- Date: Fri, 14 Jun 2002 07:53:05 -0600
Well, my first thought... why are you typecasting?
Unless you're really sure, you shouldn't be typecasting, and you should
never be typecasting inside the NewXXXUPP calls.
So, this:
rocUPP =
(ThreadEntryUPP)NewThreadEntryUPP((ThreadEntryProcPtr)WorkerThreadProc);
should just be
rocUPP = NewThreadEntryUPP(WorkerThreadProc);
If you can't do this, then I'd question why. Let the compiler work for you
:)
So, what does the prototype for the callbacks (like WorkerThreadProc) look
like?
Bryan
>
-----Original Message-----
>
From: Terence Goggin [mailto:email@hidden]
>
Sent: Friday, June 14, 2002 2:31 AM
>
To: email@hidden; email@hidden
>
Subject: Porting SimpleHTTPServer to CW/C++
>
>
>
Hi all,
>
>
While porting some code (based on Quinn's SimpleHTTPServer) to
>
CodeWarrior/C++, I got 3 errors, all related to threads and
>
UPPs.
>
>
I suspect that they're related to my inclusion of some of the
>
HTTPServer functions as methods of a class, but this is just a
>
guess.
>
>
Has anyone ever had to deal with these before? If so, can you
>
help shed some light on this? I doubt I've got the experience
>
to know what to do next. (I've pasted the error text below,
>
if that helps.)
>
>
Thanks (as always!)
>
>
Terence
>
>
-------------------------------------------------------
>
>
Error : illegal explicit conversion from 'void' to
>
'pascal void * (*)(void *)'
>
ASNetwork.cp line 758 rocUPP =
>
(ThreadEntryUPP)NewThreadEntryUPP((ThreadEntryProcPtr)WorkerTh
>
readProc);
>
>
Error : illegal explicit conversion from 'void' to
>
'pascal void * (*)(void *)'
>
ASNetwork.cp line 881 ProcUPP =
>
(ThreadEntryUPP)NewThreadEntryUPP((ThreadEntryProcPtr)
>
HTTPServerProc);
>
>
Error : illegal explicit conversion from 'void' to
>
'pascal void (*)(void *, unsigned long, long, void *)'
>
ASNetwork.cp line 965 gYieldingNotifierUPP =
>
NewOTNotifyUPP((OTNotifyProcPtr)YieldingNotifier);
>
_______________________________________________
>
carbon-development mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/carbon-development
>
Do not post admin requests to the list. They will be ignored.
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.