[hipl-dev] [Branch ~hipl-core/hipl/trunk] Rev 5221: Replace HIP_IFCS macro by simple if/else construct.

  • From: noreply@xxxxxxxxxxxxx
  • To: HIPL core team <hipl-dev@xxxxxxxxxxxxx>
  • Date: Tue, 30 Nov 2010 10:52:31 -0000

------------------------------------------------------------
revno: 5221
committer: Diego Biurrun <diego@xxxxxxxxxx>
branch nick: hipl
timestamp: Tue 2010-11-30 11:48:49 +0100
message:
  Replace HIP_IFCS macro by simple if/else construct.
  
  A macro to implement a simple if/else condition as a pseudofunction is a
  very suspicious construct to begin with and in this case, it caused the
  following compilation failure when optimizing for size (-Os):
  
  modules/update/hipd/update.c: In function ‘hip_check_update_freshness’:
  modules/update/hipd/update.c:152: error: inlining failed in call to 
‘hip_update_get_out_id’: optimizing for size and code size would grow
  modules/update/hipd/update.c:1040: error: called from here
  modules/update/hipd/update.c:152: error: inlining failed in call to 
‘hip_update_get_out_id’: optimizing for size and code size would grow
  modules/update/hipd/update.c:1070: error: called from here
  modules/update/hipd/update.c:152: error: inlining failed in call to 
‘hip_update_get_out_id’: optimizing for size and code size would grow
  modules/update/hipd/update.c:1072: error: called from here
modified:
  modules/update/hipd/update.c


--
lp:hipl
https://code.launchpad.net/~hipl-core/hipl/trunk

Your team HIPL core team is subscribed to branch lp:hipl.
To unsubscribe from this branch go to 
https://code.launchpad.net/~hipl-core/hipl/trunk/+edit-subscription
=== modified file 'modules/update/hipd/update.c'
--- modules/update/hipd/update.c        2010-11-30 09:48:11 +0000
+++ modules/update/hipd/update.c        2010-11-30 10:48:49 +0000
@@ -151,8 +151,11 @@
 */
 static inline uint32_t hip_update_get_out_id(struct update_state *state)
 {
-    HIP_IFCS(state, return (state->update_id_out - 1));
-    return -1;
+    if (state) {
+        return state->update_id_out - 1;
+    } else {
+        return -1;
+    }
 }
 
 /**

Other related posts:

  • » [hipl-dev] [Branch ~hipl-core/hipl/trunk] Rev 5221: Replace HIP_IFCS macro by simple if/else construct. - noreply