New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Constants instead of #define #3

Closed
justinjdickow opened this Issue Oct 24, 2014 · 2 comments

Comments

Projects
2 participants
@justinjdickow
Contributor

justinjdickow commented Oct 24, 2014

The parameter key and value constants defined in SDLNames.h should use extern instead of define for safe compile time type checking and to avoid collisions.

Apple's Recommendation suggests

Define constants for strings used for such purposes as notification names and dictionary keys. By using string constants, you are ensuring that the compiler verifies the proper value is specified (that is, it performs spell checking).

@joeljfischer

This comment has been minimized.

Show comment
Hide comment
@joeljfischer

joeljfischer Oct 29, 2014

Member

Along with #7 I think this is part of a general overhaul of constants that may also include SDLEnums to be considered for making the library more internally consistent and consistent with platform best practices.

Member

joeljfischer commented Oct 29, 2014

Along with #7 I think this is part of a general overhaul of constants that may also include SDLEnums to be considered for making the library more internally consistent and consistent with platform best practices.

@joeljfischer joeljfischer changed the title from SDLNames constants should use const instead of define to Use Constants instead of #define Jan 16, 2015

@joeljfischer joeljfischer added this to the 4.0.0 milestone Feb 19, 2015

@joeljfischer joeljfischer modified the milestones: 5.0.0, 4.0.0 Mar 18, 2015

@joeljfischer

This comment has been minimized.

Show comment
Hide comment
@joeljfischer

joeljfischer Sep 16, 2016

Member

Additionally, these defines cause greater memory use because a new string is instantiated every time the macro is used; with constants only one string would be used.

Member

joeljfischer commented Sep 16, 2016

Additionally, these defines cause greater memory use because a new string is instantiated every time the macro is used; with constants only one string would be used.

@joeljfischer joeljfischer added this to Done in v5.0.0 Apr 13, 2017

davidswi pushed a commit to davidswi/sdl_ios that referenced this issue Nov 15, 2017

Madhu Yaduguri
Merge pull request smartdevicelink#3 in UIES/sdl_ios from bugfix/1890…
…0 to xevo_master

* commit '378a029e372c9bbed7648c55de1cb6148cd8edba':
  Catch UIApplicationWillTerminate in proxy and dispose to close EASession.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment