Bug 431677 - outparam errors in netwerk/cookie, r=dmandelin
authorBenjamin Smedberg <benjamin@smedbergs.us>
Thu, 01 May 2008 15:12:33 -0400
changeset 14838 f337857f6837df02cf1a59e41afd2957622cc96a
parent 14837 22552b22344c29ea92ebadb89544226e59fabf99
child 14892 7a96b5181691d464af1bf0601e54c6b6b1763275
push idunknown
push userunknown
push dateunknown
reviewersdmandelin
bugs431677
milestone2.0a1pre
Bug 431677 - outparam errors in netwerk/cookie, r=dmandelin
xpcom/analysis/outparams.js
xpcom/base/nscore.h
xpcom/glue/nsArrayEnumerator.h
--- a/xpcom/analysis/outparams.js
+++ b/xpcom/analysis/outparams.js
@@ -680,19 +680,19 @@ OutparamCheck.prototype.func_param_seman
   return ans;
 };
 
 // Return the param semantics as indicated by the attributes.
 function param_semantics(decl) {
   for each (let attr in rectify_attributes(DECL_ATTRIBUTES(decl))) {
     if (attr.name == 'user') {
       for each (let arg in attr.args) {
-        if (arg == 'outparam') {
+        if (arg == 'NS_outparam') {
           return ps.OUT;
-        } else if (arg == 'inoutparam') {
+        } else if (arg == 'NS_inoutparam') {
           return ps.INOUT;
         }
       }
     }
   }
   return ps.CONST;
 }
 
--- a/xpcom/base/nscore.h
+++ b/xpcom/base/nscore.h
@@ -251,29 +251,16 @@
 # define NS_DEPRECATED __attribute__((deprecated))
 #elif defined(_MSC_VER) && (_MSC_VER >= 1300)
 # define NS_DEPRECATED __declspec(deprecated)
 #else
 # define NS_DEPRECATED
 #endif
 
 /**
- * Attributes defined to help Dehydra GCC analysis.	
- */
-#ifdef STATIC_CHECKING
-# define NS_SCRIPTABLE __attribute__((user("NS_script")))
-# define NS_OUTPARAM  __attribute__((user("NS_outparam")))
-# define NS_INOUTPARAM __attribute__((user("NS_inoutparam")))
-#else
-# define NS_SCRIPTABLE
-# define NS_OUTPARAM
-# define NS_INOUTPARAM
-#endif
-
-/**
  * Generic API modifiers which return the standard XPCOM nsresult type
  */
 #define NS_IMETHOD          NS_IMETHOD_(nsresult)
 #define NS_IMETHODIMP       NS_IMETHODIMP_(nsresult)
 #define NS_METHOD           NS_METHOD_(nsresult)
 #define NS_CALLBACK(_name)  NS_CALLBACK_(nsresult, _name)
 
 /**
@@ -504,9 +491,22 @@ typedef PRUint32 nsrefcnt;
 #ifdef NS_STATIC_CHECKING
 #define NS_STACK_CLASS __attribute__((user("NS_stack")))
 #define NS_FINAL_CLASS __attribute__((user("NS_final")))
 #else
 #define NS_STACK_CLASS
 #define NS_FINAL_CLASS
 #endif
 
+/**
+ * Attributes defined to help Dehydra GCC analysis.	
+ */
+#ifdef NS_STATIC_CHECKING
+# define NS_SCRIPTABLE __attribute__((user("NS_script")))
+# define NS_OUTPARAM  __attribute__((user("NS_outparam")))
+# define NS_INOUTPARAM __attribute__((user("NS_inoutparam")))
+#else
+# define NS_SCRIPTABLE
+# define NS_OUTPARAM
+# define NS_INOUTPARAM
+#endif
+
 #endif /* nscore_h___ */
--- a/xpcom/glue/nsArrayEnumerator.h
+++ b/xpcom/glue/nsArrayEnumerator.h
@@ -46,20 +46,20 @@
 
 class nsISimpleEnumerator;
 class nsIArray;
 class nsCOMArray_base;
 
 // Create an enumerator for an existing nsIArray implementation
 // The enumerator holds an owning reference to the array.
 NS_COM_GLUE nsresult
-NS_NewArrayEnumerator(nsISimpleEnumerator* *result,
+NS_NewArrayEnumerator(nsISimpleEnumerator* *result NS_OUTPARAM,
                       nsIArray* array);
 
 // create an enumerator for an existing nsCOMArray<T> implementation
 // The enumerator will hold an owning reference to each ELEMENT in
 // the array. This means that the nsCOMArray<T> can safely go away
 // without its objects going away.
 NS_COM_GLUE nsresult
-NS_NewArrayEnumerator(nsISimpleEnumerator* *aResult,
+NS_NewArrayEnumerator(nsISimpleEnumerator* *aResult NS_OUTPARAM,
                       const nsCOMArray_base& aArray);
 
 #endif