[PD] Sending negative numbers over OSC

Martin Peach martinrp at vax2.concordia.ca
Fri Dec 19 16:55:41 CET 2003


Notice that this fix was for the problem with negative ints.
The floats would be repaired like this:
around line 750:
###
   case f: {
     int i = ntohl(*((int *)p));
to
   case f: {
     int i = (signed)ntohl(*((int *)p));
###
Now negative ints and floats seem to work, for me at least...
Martin


Frank Barknecht wrote:
> Hallo,
> B. Bogart hat gesagt: // B. Bogart wrote:
> 
> 
>>I posted this a while back, I fixed it by turning typetags off.
>>
>>Problem is I can't send file paths with typetags off so I switch it on and
>>off depending  on the message I send (yuck!)
>>
>>Martin Peach posted a patch/fix I think, check the archives.
>>
> 
> Thanks, I've found it, Martin wrote:
> ### 
> In OSCx/OSC/dumpOSC.c line 743, in the function
> dumpOSC_PrintTypeTaggedArgs():
> 
> change
>  SETFLOAT(mya+myargc,ntohl(*((int *) p)));
> to
>  SETFLOAT(mya+myargc,(signed)ntohl(*((int *) p)));
> 
> ...since ntohl returns an unsigned integer, you get 0xFFFFFFFF for -1,
> which equals 4294967295 decimal...
> ###
> 
> I'll try this tomorrow and after that will commit it to CVS.



> 
> ciao
> 







More information about the Pd-list mailing list