What do I need to do to use tgmath on iOS?

Rob Jones

I'm compiling my first project with 64 bit support enabled. I'm running into a bunch of compiler warnings about implicit conversions to float. This is happening because I'm using fabsf() and assigning the result to a CGFloat (which is a double, not float on the new 64 bit architecture).

According to the answer on this question:

CGFloat-based math functions?

I just need to #include <tgmath.h> to solve this problem and probably change fabsf to fabs. I have at least one file where this doesn't seem to be helping. I still get the warning: implicit conversion loses floating-point precision 'double' to 'CGFloat' aka (float). Here's the line that generates that warning:

CGFloat deltaX = fabs(item.center.x-point.x);

Has anyone else run across this? How did you solve it? I'd rather not disable this warning or litter my code with a ton of typecasts.

Rob Jones

I was able to get the tgmath.h functions to work by including the header at the top of my PCH file.

At some point (read: Xcode update) I had to start disabling Modules to get this to work. The details of such are in the question Dima links to below.

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Why do I need depthBuffer to use RenderTexture?

来自分类Dev

Do I need STUN?

来自分类Dev

OpenSSL for making iOS certs on a windows machine - do I need a server?

来自分类Dev

What regex do I need for Java String.split for this case

来自分类Dev

What version of Hive do I need to have timestamps with more than 6 decimal places in the fractional seconds?

来自分类Dev

Why do I need to use the unit type in F# if it supports the void type?

来自分类Dev

Why do I need to update uvs?

来自分类Dev

Do I need to free popup menus in GTK?

来自分类Dev

Which keys do I need for CNContactFormatter?

来自分类Dev

When do we need to use verify method of Mockito?

来自分类Dev

在iOS上使用tgmath我需要做什么?

来自分类Dev

在iOS上使用tgmath我需要怎么做?

来自分类Dev

Do I need to set type face-manually to roboto-light if i am targeting api 11+ or can I just use android:fontFamily="sans-serif-light"

来自分类Dev

what can I do with hadoop and elasticsearch together?

来自分类Dev

Do I need to cleanup my event handlers when DOM changes?

来自分类Dev

Do I need to commit a code if doing an insert before an update?

来自分类Dev

Why do i need the gil for PyMem_Malloc()?

来自分类Dev

Do I need rel="nofollow" in external scripts and stylesheets?

来自分类Dev

Do I need to sudo when running pip/easy_install?

来自分类Dev

Atomic Operation Thread Safety - Do I Need a "Mirror" Atomic Read?

来自分类Dev

Do I need to call delete before reassigning a pointer?

来自分类Dev

Why do I need another constructor in an extended abstract class?

来自分类Dev

Do I need a keyring password on a luks encrypted single user machine?

来自分类Dev

I want to be able to import the JavaMail API and use it in Android Studio. What do I do after downloading mail.jar and activation.jar?

来自分类Dev

What do I set up in the `init` method versus the `viewDidLoad` method?

来自分类Dev

Unfortunately the app has stopped. What can I do to fix this?

来自分类Dev

Why do we need to use import 'babel-polyfill'; in react components?

来自分类Dev

How do I use matplotlib's event handing inside wxPython?

来自分类Dev

In Corona SDK, how do I use the 'and' keyword in if, elseif, else statements?

Related 相关文章

  1. 1

    Why do I need depthBuffer to use RenderTexture?

  2. 2

    Do I need STUN?

  3. 3

    OpenSSL for making iOS certs on a windows machine - do I need a server?

  4. 4

    What regex do I need for Java String.split for this case

  5. 5

    What version of Hive do I need to have timestamps with more than 6 decimal places in the fractional seconds?

  6. 6

    Why do I need to use the unit type in F# if it supports the void type?

  7. 7

    Why do I need to update uvs?

  8. 8

    Do I need to free popup menus in GTK?

  9. 9

    Which keys do I need for CNContactFormatter?

  10. 10

    When do we need to use verify method of Mockito?

  11. 11

    在iOS上使用tgmath我需要做什么?

  12. 12

    在iOS上使用tgmath我需要怎么做?

  13. 13

    Do I need to set type face-manually to roboto-light if i am targeting api 11+ or can I just use android:fontFamily="sans-serif-light"

  14. 14

    what can I do with hadoop and elasticsearch together?

  15. 15

    Do I need to cleanup my event handlers when DOM changes?

  16. 16

    Do I need to commit a code if doing an insert before an update?

  17. 17

    Why do i need the gil for PyMem_Malloc()?

  18. 18

    Do I need rel="nofollow" in external scripts and stylesheets?

  19. 19

    Do I need to sudo when running pip/easy_install?

  20. 20

    Atomic Operation Thread Safety - Do I Need a "Mirror" Atomic Read?

  21. 21

    Do I need to call delete before reassigning a pointer?

  22. 22

    Why do I need another constructor in an extended abstract class?

  23. 23

    Do I need a keyring password on a luks encrypted single user machine?

  24. 24

    I want to be able to import the JavaMail API and use it in Android Studio. What do I do after downloading mail.jar and activation.jar?

  25. 25

    What do I set up in the `init` method versus the `viewDidLoad` method?

  26. 26

    Unfortunately the app has stopped. What can I do to fix this?

  27. 27

    Why do we need to use import 'babel-polyfill'; in react components?

  28. 28

    How do I use matplotlib's event handing inside wxPython?

  29. 29

    In Corona SDK, how do I use the 'and' keyword in if, elseif, else statements?

热门标签

归档