Patchwork [14/16] clutter-box2d: Replace use of finite macro with C99 compliant isfinite()

login
register
mail settings
Submitter Khem Raj
Date July 19, 2011, 12:17 a.m.
Message ID <d12eac7e3b3d9c368f99e4163fb297858e577d00.1311034342.git.raj.khem@gmail.com>
Download mbox | patch
Permalink /patch/7793/
State New, archived
Headers show

Comments

Khem Raj - July 19, 2011, 12:17 a.m.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../clutter/clutter-box2d/isfinite.patch           |   19 +++++++++++++++++++
 meta/recipes-graphics/clutter/clutter-box2d_git.bb |    6 ++++--
 2 files changed, 23 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch
Saul Wold - July 20, 2011, 12:45 a.m.
On 07/18/2011 05:17 PM, Khem Raj wrote:
> Signed-off-by: Khem Raj<raj.khem@gmail.com>
> ---
>   .../clutter/clutter-box2d/isfinite.patch           |   19 +++++++++++++++++++
>   meta/recipes-graphics/clutter/clutter-box2d_git.bb |    6 ++++--
>   2 files changed, 23 insertions(+), 2 deletions(-)
>   create mode 100644 meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch
>
> diff --git a/meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch b/meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch
> new file mode 100644
> index 0000000..fd2bf74
> --- /dev/null
> +++ b/meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch
> @@ -0,0 +1,19 @@
> +_finite is obsoleted and C99 has isfinite instead so we should use it
> +
> +Signed-off-by: Khem Raj<raj.khem@gmail.com>
> +
> +Upstream-Status: Pending
> +
> +Index: clutter-box2d-0.10.0/box2d/Source/Common/b2Math.h
> +===================================================================
> +--- clutter-box2d-0.10.0.orig/box2d/Source/Common/b2Math.h	2008-12-16 06:42:10.000000000 -0800
> ++++ clutter-box2d-0.10.0/box2d/Source/Common/b2Math.h	2011-07-17 02:10:29.833825198 -0700
> +@@ -60,7 +60,7 @@
> + #ifdef _MSC_VER
> + 	return _finite(x) != 0;
> + #else
> +-	return finite(x) != 0;
> ++	return std::isfinite(x) != 0;
> + #endif
> + }
> +
> diff --git a/meta/recipes-graphics/clutter/clutter-box2d_git.bb b/meta/recipes-graphics/clutter/clutter-box2d_git.bb
> index bfd46b2..06f5fa2 100644
> --- a/meta/recipes-graphics/clutter/clutter-box2d_git.bb
> +++ b/meta/recipes-graphics/clutter/clutter-box2d_git.bb
> @@ -4,9 +4,11 @@ LIC_FILES_CHKSUM = "file://box2d/License.txt;md5=e5d39ad91f7dc4692dcdb1d85139ec6
>
>   SRCREV = "4799ac10ae8cb7da936a2b999aba58fe62eb1ee3"
>   PV = "0.10.1+git${SRCPV}"
> -PR = "r0"
> +PR = "r1"
>
> -SRC_URI = "git://git.gnome.org/clutter-box2d.git"
> +SRC_URI = "git://git.gnome.org/clutter-box2d.git \
> +           file://isfinite.patch \
> +          "
>
>   S = "${WORKDIR}/git"
>

Khem,

This patch seems to have patched clutter-box2d-1.6_0.10.0.bb also, with 
the isfinite patch.  This fails to apply.  Was this intentional were you 
planning on updating the 1.6 version?

Sau!
Khem Raj - July 20, 2011, 4:33 a.m.
On Tue, Jul 19, 2011 at 5:45 PM, Saul Wold <sgw@linux.intel.com> wrote:
> On 07/18/2011 05:17 PM, Khem Raj wrote:
>>
>> Signed-off-by: Khem Raj<raj.khem@gmail.com>
>> ---
>>  .../clutter/clutter-box2d/isfinite.patch           |   19
>> +++++++++++++++++++
>>  meta/recipes-graphics/clutter/clutter-box2d_git.bb |    6 ++++--
>>  2 files changed, 23 insertions(+), 2 deletions(-)
>>  create mode 100644
>> meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch
>>
>> diff --git a/meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch
>> b/meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch
>> new file mode 100644
>> index 0000000..fd2bf74
>> --- /dev/null
>> +++ b/meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch
>> @@ -0,0 +1,19 @@
>> +_finite is obsoleted and C99 has isfinite instead so we should use it
>> +
>> +Signed-off-by: Khem Raj<raj.khem@gmail.com>
>> +
>> +Upstream-Status: Pending
>> +
>> +Index: clutter-box2d-0.10.0/box2d/Source/Common/b2Math.h
>> +===================================================================
>> +--- clutter-box2d-0.10.0.orig/box2d/Source/Common/b2Math.h     2008-12-16
>> 06:42:10.000000000 -0800
>> ++++ clutter-box2d-0.10.0/box2d/Source/Common/b2Math.h  2011-07-17
>> 02:10:29.833825198 -0700
>> +@@ -60,7 +60,7 @@
>> + #ifdef _MSC_VER
>> +       return _finite(x) != 0;
>> + #else
>> +-      return finite(x) != 0;
>> ++      return std::isfinite(x) != 0;
>> + #endif
>> + }
>> +
>> diff --git a/meta/recipes-graphics/clutter/clutter-box2d_git.bb
>> b/meta/recipes-graphics/clutter/clutter-box2d_git.bb
>> index bfd46b2..06f5fa2 100644
>> --- a/meta/recipes-graphics/clutter/clutter-box2d_git.bb
>> +++ b/meta/recipes-graphics/clutter/clutter-box2d_git.bb
>> @@ -4,9 +4,11 @@ LIC_FILES_CHKSUM =
>> "file://box2d/License.txt;md5=e5d39ad91f7dc4692dcdb1d85139ec6
>>
>>  SRCREV = "4799ac10ae8cb7da936a2b999aba58fe62eb1ee3"
>>  PV = "0.10.1+git${SRCPV}"
>> -PR = "r0"
>> +PR = "r1"
>>
>> -SRC_URI = "git://git.gnome.org/clutter-box2d.git"
>> +SRC_URI = "git://git.gnome.org/clutter-box2d.git \
>> +           file://isfinite.patch \
>> +          "
>>
>>  S = "${WORKDIR}/git"
>>
>
> Khem,
>
> This patch seems to have patched clutter-box2d-1.6_0.10.0.bb also, with the
> isfinite patch.  This fails to apply.  Was this intentional were you
> planning on updating the 1.6 version?

yes the patch should be applied to both recipes since x86 uses
clutter-box2d-1.6_0.10.0.bb
and arm uses the git version. It applied well for arm and x86 here.
Let me check once more

>
> Sau!
>
Khem Raj - July 20, 2011, 5:15 a.m.
On Tue, Jul 19, 2011 at 9:33 PM, Khem Raj <raj.khem@gmail.com> wrote:
> On Tue, Jul 19, 2011 at 5:45 PM, Saul Wold <sgw@linux.intel.com> wrote:
>> On 07/18/2011 05:17 PM, Khem Raj wrote:
>>>
>>> Signed-off-by: Khem Raj<raj.khem@gmail.com>
>>> ---
>>>  .../clutter/clutter-box2d/isfinite.patch           |   19
>>> +++++++++++++++++++
>>>  meta/recipes-graphics/clutter/clutter-box2d_git.bb |    6 ++++--
>>>  2 files changed, 23 insertions(+), 2 deletions(-)
>>>  create mode 100644
>>> meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch
>>>
>>> diff --git a/meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch
>>> b/meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch
>>> new file mode 100644
>>> index 0000000..fd2bf74
>>> --- /dev/null
>>> +++ b/meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch
>>> @@ -0,0 +1,19 @@
>>> +_finite is obsoleted and C99 has isfinite instead so we should use it
>>> +
>>> +Signed-off-by: Khem Raj<raj.khem@gmail.com>
>>> +
>>> +Upstream-Status: Pending
>>> +
>>> +Index: clutter-box2d-0.10.0/box2d/Source/Common/b2Math.h
>>> +===================================================================
>>> +--- clutter-box2d-0.10.0.orig/box2d/Source/Common/b2Math.h     2008-12-16
>>> 06:42:10.000000000 -0800
>>> ++++ clutter-box2d-0.10.0/box2d/Source/Common/b2Math.h  2011-07-17
>>> 02:10:29.833825198 -0700
>>> +@@ -60,7 +60,7 @@
>>> + #ifdef _MSC_VER
>>> +       return _finite(x) != 0;
>>> + #else
>>> +-      return finite(x) != 0;
>>> ++      return std::isfinite(x) != 0;
>>> + #endif
>>> + }
>>> +
>>> diff --git a/meta/recipes-graphics/clutter/clutter-box2d_git.bb
>>> b/meta/recipes-graphics/clutter/clutter-box2d_git.bb
>>> index bfd46b2..06f5fa2 100644
>>> --- a/meta/recipes-graphics/clutter/clutter-box2d_git.bb
>>> +++ b/meta/recipes-graphics/clutter/clutter-box2d_git.bb
>>> @@ -4,9 +4,11 @@ LIC_FILES_CHKSUM =
>>> "file://box2d/License.txt;md5=e5d39ad91f7dc4692dcdb1d85139ec6
>>>
>>>  SRCREV = "4799ac10ae8cb7da936a2b999aba58fe62eb1ee3"
>>>  PV = "0.10.1+git${SRCPV}"
>>> -PR = "r0"
>>> +PR = "r1"
>>>
>>> -SRC_URI = "git://git.gnome.org/clutter-box2d.git"
>>> +SRC_URI = "git://git.gnome.org/clutter-box2d.git \
>>> +           file://isfinite.patch \
>>> +          "
>>>
>>>  S = "${WORKDIR}/git"
>>>
>>
>> Khem,
>>
>> This patch seems to have patched clutter-box2d-1.6_0.10.0.bb also, with the
>> isfinite patch.  This fails to apply.  Was this intentional were you
>> planning on updating the 1.6 version?
>
> yes the patch should be applied to both recipes since x86 uses
> clutter-box2d-1.6_0.10.0.bb
> and arm uses the git version. It applied well for arm and x86 here.
> Let me check once more

MACHINE=qemux86 TCLIBC=uclibc bitbake -ccleanall clutter-box2d-1.6;
MACHINE=qemux86 TCLIBC=uclibc bitbake clutter-box2d-1.6

worked fine and I checked that it applied the isfinite.patch cleanly.

Although one thing I observed is that the file this patch is modifying
has DOS eols
therefore the patch also has DOS eols in it

I wonder if thats somehow problematic on your machine

>
>>
>> Sau!
>>
>

Patch

diff --git a/meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch b/meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch
new file mode 100644
index 0000000..fd2bf74
--- /dev/null
+++ b/meta/recipes-graphics/clutter/clutter-box2d/isfinite.patch
@@ -0,0 +1,19 @@ 
+_finite is obsoleted and C99 has isfinite instead so we should use it
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+
+Upstream-Status: Pending
+
+Index: clutter-box2d-0.10.0/box2d/Source/Common/b2Math.h
+===================================================================
+--- clutter-box2d-0.10.0.orig/box2d/Source/Common/b2Math.h	2008-12-16 06:42:10.000000000 -0800
++++ clutter-box2d-0.10.0/box2d/Source/Common/b2Math.h	2011-07-17 02:10:29.833825198 -0700
+@@ -60,7 +60,7 @@
+ #ifdef _MSC_VER
+ 	return _finite(x) != 0;
+ #else
+-	return finite(x) != 0;
++	return std::isfinite(x) != 0;
+ #endif
+ }
+ 
diff --git a/meta/recipes-graphics/clutter/clutter-box2d_git.bb b/meta/recipes-graphics/clutter/clutter-box2d_git.bb
index bfd46b2..06f5fa2 100644
--- a/meta/recipes-graphics/clutter/clutter-box2d_git.bb
+++ b/meta/recipes-graphics/clutter/clutter-box2d_git.bb
@@ -4,9 +4,11 @@  LIC_FILES_CHKSUM = "file://box2d/License.txt;md5=e5d39ad91f7dc4692dcdb1d85139ec6
 
 SRCREV = "4799ac10ae8cb7da936a2b999aba58fe62eb1ee3"
 PV = "0.10.1+git${SRCPV}"
-PR = "r0"
+PR = "r1"
 
-SRC_URI = "git://git.gnome.org/clutter-box2d.git"
+SRC_URI = "git://git.gnome.org/clutter-box2d.git \
+           file://isfinite.patch \
+          "
 
 S = "${WORKDIR}/git"