Browse Source

[objc] minor: change `NSObject *` to `id` on gencpp casts as well

Cauê Waneck 10 years ago
parent
commit
b7bd47dd5b
1 changed files with 3 additions and 3 deletions
  1. 3 3
      gencpp.ml

+ 3 - 3
gencpp.ml

@@ -1839,14 +1839,14 @@ and gen_expression ctx retval expression =
         expression
         expression
    in
    in
    let add_objc_cast_if_needed expression =
    let add_objc_cast_if_needed expression =
-      (* objc-specific: since all NSObject derived types are boxed to the same type,
+      (* objc-specific: since all `id` derived types are boxed to the same type,
          we need to take one extra care when unboxing, and cast them to their
          we need to take one extra care when unboxing, and cast them to their
          actual type *)
          actual type *)
       let is_cast =
       let is_cast =
          retval && is_objc_type expression.etype && is_dynamic_in_cpp ctx expression
          retval && is_objc_type expression.etype && is_dynamic_in_cpp ctx expression
       in
       in
       if is_cast then begin
       if is_cast then begin
-         output ("( (" ^ (type_string expression.etype) ^ ") (NSObject *) (");
+         output ("( (" ^ (type_string expression.etype) ^ ") (id) (");
          ") )";
          ") )";
       end else
       end else
          ""
          ""
@@ -2563,7 +2563,7 @@ and gen_expression ctx retval expression =
          output ")";
          output ")";
    | TCast (cast,None) when is_objc_type expression.etype && not (is_objc_type cast.etype) ->
    | TCast (cast,None) when is_objc_type expression.etype && not (is_objc_type cast.etype) ->
      let ret_type = type_string expression.etype in
      let ret_type = type_string expression.etype in
-     output ("( (" ^ ret_type ^ ") (NSObject *) (");
+     output ("( (" ^ ret_type ^ ") (id) (");
      gen_expression ctx true cast;
      gen_expression ctx true cast;
      output ") )"
      output ") )"
    | TCast (cast,None) when (not retval) || (type_string expression.etype) = "Void" ->
    | TCast (cast,None) when (not retval) || (type_string expression.etype) = "Void" ->