reverted commits

Ralf Habacker ralf.habacker at freenet.de
Fri Jun 22 00:24:12 PDT 2007


Ralf Habacker schrieb:
> Havoc Pennington schrieb:
>   
>> Hi,
>>
>> Ralf Habacker wrote:
>>     
>>> where ?
>>> This issue was on the open patch list and was known and discussed
>>> several times in the dbus list.
>>> see http://lists.freedesktop.org/archives/dbus/2006-July/005081.html
>>>      http://lists.freedesktop.org/archives/dbus/2006-August/005531.html
>>>
>>> My mistake was not to use DBUS_WIN_FIXME, sorry for that.
>>>       
>> I probably was thinking of
>> https://bugs.freedesktop.org/show_bug.cgi?id=7960
>>
>> In any case, the point stands and would have come up if the patch were
>> posted.
>>     
> Thanks for this pointer. This wasn't refered in the list.
>
> On a recent linux system the double representation of 0xff is 0.0?  Then
> is it easy to create a _dbus_strtod, which catches this special case.
>
> *double _dbus_strtod(const char **/nptr/*, char ***/endptr)
> {
> 	if (strlen(nptr) = 4 && nptr[0] == '0' && nptr[1] == 'x' ///&& nptr[2] == 'f' //////&& nptr[3] == 'f') 
> 	  {
>              if (endptr)
> 		*endptr = nptr+4;
> ///	     return 0.0/;
>           }
> /	return strtod(nptr,endptr); 
> } 
>
> Any problems with this patch ? 
>
>   
BTW: I do not know why the email client had added all these additional
characters in the email (i copied some code from a website), hope the
following is better

double dbus_strtod(const char *nptr, char **endptr)
{
    if (nptr && strlen(nptr) == 4 && nptr[0] == '0' && nptr[1] == 'x' &&
nptr[2] == 'f' && nptr[3] == 'f')
      {
        if (endptr)
          *endptr = nptr+4;
        return 0.0;
      }
    return strtod(nptr,endptr);
}

There are still some issues. This function will be used in libdbus and
dbus-send. Therefore it must be a public dbus function or how to proceed ?

Ralf





Ralf



More information about the dbus mailing list