[PD] weird pdp code

Jonathan Wilkes jancsika at yahoo.com
Sat Feb 20 23:30:17 CET 2016


Some OSX details:OS X El CapitanVersion 10.11.2
Samples of the errors using /usr/bin/gcc or usr/bin/clang are:
pdp_imageproc_portable.c:594:38: error: function definition is not allowed here
  double mapx(double _x, double _y){return cx + izx * ( c * (_x-cx) + ...
pdp_imageproc_portable.c:595:38: error: function definition is not allowed here  double mapy(double _x, double _y){return cy + izy * (-s * (_x-cx) + ...


I found this while getting the GUI port up and running on OSX.  If anybody still uses PDP and wants to update this code to compile on OSX, let me know and I'll apply the patch(es).
-Jonathan   

 On Saturday, February 20, 2016 3:05 PM, Jonathan Wilkes via Pd-list <pd-list at lists.iem.at> wrote:
 

 > (i remember having troubles with those functions on other
compilers...but it's been years :-))
Presently it fails to compile under OSX.  It's a fairly recent mac air-- I don't have the specs atm but I'll check and post later.
-Jonathan 

    On Saturday, February 20, 2016 2:36 PM, IOhannes m zmölnig <zmoelnig at iem.at> wrote:
 

 On 02/19/2016 09:37 PM, Jonathan Wilkes via Pd-list wrote:
> Hi List,
> Line 593 of pdp_imageproc_portable.c:    /* affine x, y mappings in screen coordinates */    double mapx(double _x, double _y){return cx + izx * ( c * (_x-cx) + s * (_y-cy));}    double mapy(double _x, double _y){return cy + izy * (-s * (_x-cx) + c * (_y-cy));}
> 
> These lines are found _inside_ a function called pdp_imageproc_resample_affinemap_process.

there's nothing (much) wrong with it: nested functions are a gcc extension.
(i remember having troubles with those functions on other
compilers...but it's been years :-))


> It's fun to focus on the substring "portable.c", and just read these lines a few times. :)

"portable" means different things to different people.

for you it seems to refer to usability on multiple operating-systems and
compilers.
it could also have referred to the file-size (pdp_imageproc_portable.c
easily fits on a floppy).
knowing tom a bit, it's most likely that this is about portability
between multiple architectures all running linux (and looking at the
other files nearby this is very much the case - as the "portable" code
is opposed to code explictely using i586 instructions)

gmasrd
IOhannes

_______________________________________________
Pd-list at lists.iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list


   
_______________________________________________
Pd-list at lists.iem.at mailing list
UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list


  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20160220/1fac699b/attachment.html>


More information about the Pd-list mailing list