Comment 41 for bug 23369

Revision history for this message
In , alecf (alecf) wrote :

Comment on attachment 118755
patch (add many comments)

close! Just a few nits:
+ ReadSystemPref((const char*)aData);

you can't just cast from const PRUnichaR* to const char* - to catch errors like
this you should always use C++ style static_cast - in our codebase it is
NS_STATIC_CAST(const char*, aData) - the compiler would tell you that this is
an illegal cast.

Instead, you need to convert it from Unicode to ASCII:

ReadSystemPref(NS_LossyConvertUCS2toASCII(aData).get())

+ nsresult GetAtomForMozKey(const char *aMozKey, PRUint32 *aAtom) \
+ {return GetAtom(aMozKey, 0, aAtom); }
+ const char *GetMozKey(PRUint32 aAtom) \
+ {return GetKey(aAtom, 0); }
+

again, please dump the "\" at the end of these lines - you just don't need
them, and they will muck up the indenting in some editors

I'm almost done with this review, so hold off another day before I get through
this.