Bug 615361 warning: cast from pointer to integer of different size in jsd
authortimeless@mozdev.org
Sat, 04 Dec 2010 11:05:45 +0100
changeset 58603 1b37f953b5e44e4e390facbbf16c6ca35635bf7a
parent 58602 3e7e476a9ea09e67c845e41fb5a9b39540b9f4d8
child 58604 5fcca6b353eeff755918ccb78e8597cceaba1949
push id17377
push userdgottwald@mozilla.com
push dateSat, 04 Dec 2010 12:26:21 +0000
treeherdermozilla-central@6c885a625cb9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs615361
milestone2.0b8pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 615361 warning: cast from pointer to integer of different size in jsd r=bz
js/jsd/jsd_atom.c
js/jsd/jsd_obj.c
js/jsd/jsd_scpt.c
--- a/js/jsd/jsd_atom.c
+++ b/js/jsd/jsd_atom.c
@@ -98,17 +98,17 @@ JSBool
 jsd_CreateAtomTable(JSDContext* jsdc)
 {
     jsdc->atoms = JS_NewHashTable(256, JS_HashString,
                                   _compareAtomKeys, _compareAtoms,
                                   NULL, NULL);
 #ifdef TEST_ATOMS
     _testAtoms(jsdc);
 #endif    
-    return (JSBool) jsdc->atoms;
+    return !!jsdc->atoms;
 }
 
 void
 jsd_DestroyAtomTable(JSDContext* jsdc)
 {
     if( jsdc->atoms )
     {
         JS_HashTableEnumerateEntries(jsdc->atoms, _atom_smasher, NULL);
--- a/js/jsd/jsd_obj.c
+++ b/js/jsd/jsd_obj.c
@@ -167,27 +167,27 @@ jsd_Constructing(JSDContext* jsdc, JSCon
     }
     TRACEOBJ(jsdc, jsdobj, 3);
     JSD_UNLOCK_OBJECTS(jsdc);
 }
 
 static JSHashNumber
 _hash_root(const void *key)
 {
-    return ((JSHashNumber) key) >> 2; /* help lame MSVC1.5 on Win16 */
+    return ((JSHashNumber)(ptrdiff_t) key) >> 2; /* help lame MSVC1.5 on Win16 */
 }
 
 JSBool
 jsd_InitObjectManager(JSDContext* jsdc)
 {
     JS_INIT_CLIST(&jsdc->objectsList);
     jsdc->objectsTable = JS_NewHashTable(256, _hash_root,
                                          JS_CompareValues, JS_CompareValues,
                                          NULL, NULL);
-    return (JSBool) jsdc->objectsTable;
+    return !!jsdc->objectsTable;
 }
 
 void
 jsd_DestroyObjectManager(JSDContext* jsdc)
 {
     jsd_DestroyObjects(jsdc);
     JSD_LOCK_OBJECTS(jsdc);
     JS_HashTableDestroy(jsdc->objectsTable);
--- a/js/jsd/jsd_scpt.c
+++ b/js/jsd/jsd_scpt.c
@@ -227,17 +227,17 @@ static void
         _dumpJSDScript( jsdc, jsdscript, "  script: " );
 }
 #endif /* JSD_DUMP */
 
 /***************************************************************************/
 static JSHashNumber
 jsd_hash_script(const void *key)
 {
-    return ((JSHashNumber) key) >> 2; /* help lame MSVC1.5 on Win16 */
+    return ((JSHashNumber)(ptrdiff_t) key) >> 2; /* help lame MSVC1.5 on Win16 */
 }
 
 static void *
 jsd_alloc_script_table(void *priv, size_t size)
 {
     return malloc(size);
 }
 
@@ -274,17 +274,17 @@ static JSHashAllocOps script_alloc_ops =
 
 JSBool
 jsd_InitScriptManager(JSDContext* jsdc)
 {
     JS_INIT_CLIST(&jsdc->scripts);
     jsdc->scriptsTable = JS_NewHashTable(JSD_SCRIPT_HASH_SIZE, jsd_hash_script,
                                          JS_CompareValues, JS_CompareValues,
                                          &script_alloc_ops, (void*) jsdc);
-    return (JSBool) jsdc->scriptsTable;
+    return !!jsdc->scriptsTable;
 }
 
 void
 jsd_DestroyScriptManager(JSDContext* jsdc)
 {
     JSD_LOCK_SCRIPTS(jsdc);
     if (jsdc->scriptsTable)
         JS_HashTableDestroy(jsdc->scriptsTable);