harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r815644 - in /harmony/enhanced: classlib/trunk/modules/portlib/src/main/native/include/shared/ classlib/trunk/modules/portlib/src/main/native/thread/shared/ classlib/trunk/modules/portlib/src/main/native/thread/unix/ classlib/trunk/modules/...
Date Wed, 16 Sep 2009 07:41:40 GMT
Author: hindessm
Date: Wed Sep 16 07:41:39 2009
New Revision: 815644

URL: http://svn.apache.org/viewvc?rev=815644&view=rev
Log:
Change hythread API to use 'const char*' for constant strings rather than
'char*'.  To avoid some recent gcc compiler warnings (treated as errors).
See http://markmail.org/message/xj76uxwu5h3ue2v3

Modified:
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hythread.h
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/shared/hythread.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/shared/rwmutex.c
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/unix/thrtypes.h
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/windows/thrtypes.h
    harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thrstub/shared/hythread.h
    harmony/enhanced/drlvm/trunk/vm/include/open/hythread.h
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_classlib_defs.h
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_init.c

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hythread.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hythread.h?rev=815644&r1=815643&r2=815644&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hythread.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/include/shared/hythread.h
Wed Sep 16 07:41:39 2009
@@ -90,7 +90,7 @@
 
   typedef struct HyThreadMonitorTracing
   {
-    char *monitor_name;
+    const char *monitor_name;
     UDATA enter_count;
     UDATA slow_count;
     UDATA recursive_count;
@@ -190,7 +190,7 @@
     hythread_monitor_init
     PROTOTYPE ((hythread_monitor_t * handle, UDATA flags));
   extern HY_CFUNC IDATA VMCALL hythread_sleep PROTOTYPE ((I_64 millis));
-  extern HY_CFUNC UDATA *VMCALL hythread_global PROTOTYPE ((char *name));
+  extern HY_CFUNC UDATA *VMCALL hythread_global PROTOTYPE ((const char *name));
   extern HY_CFUNC IDATA VMCALL
     hythread_tls_alloc_with_finalizer
     PROTOTYPE ((hythread_tls_key_t * handle,

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/shared/hythread.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/shared/hythread.c?rev=815644&r1=815643&r2=815644&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/shared/hythread.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/shared/hythread.c
Wed Sep 16 07:41:39 2009
@@ -2000,7 +2000,7 @@
  * 
  */
 UDATA *VMCALL
-hythread_global (char *name)
+hythread_global (const char *name)
 {
   HyThreadGlobal *global;
   hythread_library_t lib = GLOBAL_DATA (default_library);

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/shared/rwmutex.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/shared/rwmutex.c?rev=815644&r1=815643&r2=815644&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/shared/rwmutex.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/shared/rwmutex.c
Wed Sep 16 07:41:39 2009
@@ -49,7 +49,7 @@
                        const char *name)
 {
   RWMutex *mutex = (RWMutex *) malloc (sizeof (RWMutex));
-  hythread_monitor_init_with_name (&mutex->syncMon, 0, (char *) name);
+  hythread_monitor_init_with_name (&mutex->syncMon, 0, name);
   mutex->status = 0;
   mutex->writer = 0;
 

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/unix/thrtypes.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/unix/thrtypes.h?rev=815644&r1=815643&r2=815644&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/unix/thrtypes.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/unix/thrtypes.h
Wed Sep 16 07:41:39 2009
@@ -72,7 +72,7 @@
   typedef struct HyThreadGlobal
   {
     struct HyThreadGlobal *next;
-    char *name;
+    const char *name;
     UDATA data;
   } HyThreadGlobal;
   typedef struct HyThreadLibrary

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/windows/thrtypes.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/windows/thrtypes.h?rev=815644&r1=815643&r2=815644&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/windows/thrtypes.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thread/windows/thrtypes.h
Wed Sep 16 07:41:39 2009
@@ -80,7 +80,7 @@
   typedef struct HyThreadGlobal
   {
     struct HyThreadGlobal *next;
-    char *name;
+    const char *name;
     UDATA data;
   } HyThreadGlobal;
 

Modified: harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thrstub/shared/hythread.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thrstub/shared/hythread.h?rev=815644&r1=815643&r2=815644&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thrstub/shared/hythread.h
(original)
+++ harmony/enhanced/classlib/trunk/modules/portlib/src/main/native/thrstub/shared/hythread.h
Wed Sep 16 07:41:39 2009
@@ -79,7 +79,7 @@
 
 typedef struct HyThreadMonitorTracing
 {
-	char *monitor_name;
+    const char *monitor_name;
     UDATA enter_count;
     UDATA slow_count;
     UDATA recursive_count;
@@ -111,12 +111,12 @@
   void  (PVMCALL thread_detach) (struct HyThreadLibrary * threadLibrary, hythread_t thread);
   void  (PVMCALL NORETURN thread_exit) (struct HyThreadLibrary * threadLibrary, hythread_monitor_t
monitor);
 
-  UDATA *(PVMCALL thread_global) (struct HyThreadLibrary * threadLibrary, char *name);
+  UDATA *(PVMCALL thread_global) (struct HyThreadLibrary * threadLibrary, const char *name);
 
   IDATA (PVMCALL thread_monitor_destroy) (struct HyThreadLibrary * threadLibrary, hythread_monitor_t
monitor);
   IDATA (PVMCALL thread_monitor_enter) (struct HyThreadLibrary * threadLibrary, hythread_monitor_t
monitor);
   IDATA (PVMCALL thread_monitor_exit) (struct HyThreadLibrary * threadLibrary, hythread_monitor_t
monitor);
-  IDATA (PVMCALL thread_monitor_init_with_name) (struct HyThreadLibrary * threadLibrary,
hythread_monitor_t * handle, UDATA flags, char *name);
+  IDATA (PVMCALL thread_monitor_init_with_name) (struct HyThreadLibrary * threadLibrary,
hythread_monitor_t * handle, UDATA flags, const char *name);
   IDATA (PVMCALL thread_monitor_notify) (struct HyThreadLibrary * threadLibrary, hythread_monitor_t
monitor);
   IDATA (PVMCALL thread_monitor_notify_all) (struct HyThreadLibrary * threadLibrary, hythread_monitor_t
monitor);
   IDATA (PVMCALL thread_monitor_wait) (struct HyThreadLibrary * threadLibrary, hythread_monitor_t
monitor);

Modified: harmony/enhanced/drlvm/trunk/vm/include/open/hythread.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/include/open/hythread.h?rev=815644&r1=815643&r2=815644&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/include/open/hythread.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/include/open/hythread.h Wed Sep 16 07:41:39 2009
@@ -117,7 +117,7 @@
 #define HYTHREAD_LIB_FLAG_JLMTS_ENABLED  0x8000
 
 typedef struct HyThreadMonitorTracing {
-    char* monitor_name;
+    const char* monitor_name;
     UDATA enter_count;
     UDATA slow_count;
     UDATA recursive_count;
@@ -165,11 +165,11 @@
                 void *entryarg);
   void  (PVMCALL thread_detach) (struct HyThreadLibrary *threadLibraryFuncs, hythread_t thread);
   void  (PVMCALL NORETURN thread_exit) (struct HyThreadLibrary *threadLibraryFuncs, hythread_monitor_t
monitor);
-  UDATA *(PVMCALL thread_global) (struct HyThreadLibrary *threadLibraryFuncs, char *name);
+  UDATA *(PVMCALL thread_global) (struct HyThreadLibrary *threadLibraryFuncs, const char
*name);
   IDATA (PVMCALL thread_monitor_destroy) (struct HyThreadLibrary *threadLibraryFuncs, hythread_monitor_t
monitor);
   IDATA (PVMCALL thread_monitor_enter) (struct HyThreadLibrary *threadLibraryFuncs, hythread_monitor_t
monitor);
   IDATA (PVMCALL thread_monitor_exit) (struct HyThreadLibrary *threadLibraryFuncs, hythread_monitor_t
monitor);
-  IDATA (PVMCALL thread_monitor_init_with_name) (struct HyThreadLibrary *threadLibraryFuncs,
hythread_monitor_t * handle, UDATA flags, char *name);
+  IDATA (PVMCALL thread_monitor_init_with_name) (struct HyThreadLibrary *threadLibraryFuncs,
hythread_monitor_t * handle, UDATA flags, const char *name);
   IDATA (PVMCALL thread_monitor_notify) (struct HyThreadLibrary *threadLibraryFuncs, hythread_monitor_t
monitor);
   IDATA (PVMCALL thread_monitor_notify_all) (struct HyThreadLibrary *threadLibraryFuncs,
hythread_monitor_t monitor);
   IDATA (PVMCALL thread_monitor_wait) (struct HyThreadLibrary *threadLibraryFuncs, hythread_monitor_t
monitor);
@@ -288,7 +288,7 @@
 extern HY_CFUNC IDATA VMCALL 
 hythread_sleep PROTOTYPE((I_64 millis));
 extern HY_CFUNC UDATA* VMCALL 
-hythread_global PROTOTYPE((char* name));
+hythread_global PROTOTYPE((const char* name));
 extern HY_CFUNC IDATA VMCALL 
 hythread_tls_alloc_with_finalizer PROTOTYPE((hythread_tls_key_t* handle, hythread_tls_finalizer_t
finalizer));
 extern HY_CFUNC void VMCALL 
@@ -333,7 +333,7 @@
 hythread_monitor_get_tracing PROTOTYPE((hythread_monitor_t monitor));
 extern HY_CFUNC UDATA VMCALL 
 hythread_get_priority PROTOTYPE((hythread_t thread));
-extern HY_CFUNC char* VMCALL 
+extern HY_CFUNC const char* VMCALL 
 hythread_monitor_get_name PROTOTYPE((hythread_monitor_t monitor));
 extern HY_CFUNC hythread_monitor_t VMCALL 
 hythread_monitor_walk PROTOTYPE((hythread_monitor_t monitor));

Modified: harmony/enhanced/drlvm/trunk/vm/thread/src/thread_classlib_defs.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_classlib_defs.h?rev=815644&r1=815643&r2=815644&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/thread/src/thread_classlib_defs.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/thread/src/thread_classlib_defs.h Wed Sep 16 07:41:39
2009
@@ -73,7 +73,7 @@
 }
 
 
-UDATA * VMCALL hythread_global_cl(HyThreadLibrary *threadLibraryFuncs, char *name) 
+UDATA * VMCALL hythread_global_cl(HyThreadLibrary *threadLibraryFuncs, const char *name)

 {
     return hythread_global(name);
 }
@@ -93,7 +93,7 @@
     return hythread_monitor_exit(monitor);
 }
 
-IDATA VMCALL hythread_monitor_init_with_name_cl(HyThreadLibrary *threadLibraryFuncs, hythread_monitor_t
* handle, UDATA flags, char *name) 
+IDATA VMCALL hythread_monitor_init_with_name_cl(HyThreadLibrary *threadLibraryFuncs, hythread_monitor_t
* handle, UDATA flags, const char *name) 
 {
     return hythread_monitor_init_with_name(handle, flags, name);
 }

Modified: harmony/enhanced/drlvm/trunk/vm/thread/src/thread_init.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_init.c?rev=815644&r1=815643&r2=815644&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/thread/src/thread_init.c (original)
+++ harmony/enhanced/drlvm/trunk/vm/thread/src/thread_init.c Wed Sep 16 07:41:39 2009
@@ -474,14 +474,14 @@
 // need to be hashtable in the future
 */
 #define TABLE_SIZE 256
-char *names[TABLE_SIZE];
+const char *names[TABLE_SIZE];
 UDATA data[TABLE_SIZE];
 int size = 0;
 
 /*
  * return index in array if found, -1 otherwise
  */
-int find_entry (char* name) {
+int find_entry (const char* name) {
     // quick pass
     int i;
     for (i = 0; i < size; i++) {
@@ -499,7 +499,7 @@
 }
 //add entry to the end of the array
 // return new entry index,  -1 if failed.
-int add_entry(char* name) {
+int add_entry(const char* name) {
     int index = size++;
     if (index >= TABLE_SIZE-1) {
         return -1;
@@ -520,7 +520,7 @@
  * 0 on failure.
  * 
  */
-UDATA* VMCALL hythread_global (char* name) {
+UDATA* VMCALL hythread_global (const char* name) {
     //hythread_monitor_enter(*p_global_monitor);
     int index = find_entry(name);
     if (index == -1) {



Mime
View raw message