From 4220afa52a0e22a9e99ff50c6878b25d19f1f312 Mon Sep 17 00:00:00 2001
From: unknown <serg@janus.mylan>
Date: Tue, 18 Dec 2007 23:22:55 +0100
Subject: [PATCH] solaris fixes

include/lf.h:
  Forte fixes
---
 include/lf.h                        | 8 ++++----
 storage/maria/lockman.c             | 8 ++++----
 storage/maria/lockman.h             | 4 ++--
 storage/maria/tablockman.c          | 6 +++---
 storage/maria/tablockman.h          | 4 ++--
 storage/maria/unittest/lockman-t.c  | 2 +-
 storage/maria/unittest/lockman1-t.c | 2 +-
 storage/maria/unittest/lockman2-t.c | 2 +-
 8 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/include/lf.h b/include/lf.h
index 8d26efd1232..d4c5c64a01b 100644
--- a/include/lf.h
+++ b/include/lf.h
@@ -168,15 +168,15 @@ void lf_pinbox_destroy(LF_PINBOX *pinbox);
 lock_wrap(lf_pinbox_get_pins, LF_PINS *,
           (LF_PINBOX *pinbox, void *stack_end),
           (pinbox, stack_end),
-          &pinbox->pinarray.lock);
+          &pinbox->pinarray.lock)
 lock_wrap_void(lf_pinbox_put_pins,
                (LF_PINS *pins),
                (pins),
-               &pins->pinbox->pinarray.lock);
+               &pins->pinbox->pinarray.lock)
 lock_wrap_void(lf_pinbox_free,
                (LF_PINS *pins, void *addr),
                (pins, addr),
-               &pins->pinbox->pinarray.lock);
+               &pins->pinbox->pinarray.lock)
 
 /*
   memory allocator, lf_alloc-pin.c
@@ -211,7 +211,7 @@ uint lf_alloc_pool_count(LF_ALLOCATOR *allocator);
 lock_wrap(lf_alloc_new, void *,
           (LF_PINS *pins),
           (pins),
-          &pins->pinbox->pinarray.lock);
+          &pins->pinbox->pinarray.lock)
 
 /*
   extendible hash, lf_hash.c
diff --git a/storage/maria/lockman.c b/storage/maria/lockman.c
index c9b753fb492..88642461216 100644
--- a/storage/maria/lockman.c
+++ b/storage/maria/lockman.c
@@ -146,7 +146,7 @@ static int lock_compatibility_matrix[10][10]=
 
   One should never get N from it, we assert the impossibility
 */
-static enum lock_type lock_combining_matrix[10][10]=
+static enum lockman_lock_type lock_combining_matrix[10][10]=
 {/*    N    S   X    IS    IX  SIX    LS    LX   SLX   LSIX         */
   {    N,   S,  X,   IS,   IX, SIX,    S,  SLX, SLX,  SIX}, /* N    */
   {    S,   S,  X,    S,  SIX, SIX,    S,  SLX, SLX,  SIX}, /* S    */
@@ -249,7 +249,7 @@ static int lockfind(LOCK * volatile *head, LOCK *node,
   uint64        resource, cur_resource;
   intptr        cur_link;
   my_bool       cur_active, compatible, upgrading, prev_active;
-  enum lock_type lock, prev_lock, cur_lock;
+  enum lockman_lock_type lock, prev_lock, cur_lock;
   uint16        loid, cur_loid;
   int           cur_flags, flags;
 
@@ -596,13 +596,13 @@ static inline uint calc_hash(uint64 resource)
 */
 enum lockman_getlock_result lockman_getlock(LOCKMAN *lm, LOCK_OWNER *lo,
                                             uint64 resource,
-                                            enum lock_type lock)
+                                            enum lockman_lock_type lock)
 {
   int res;
   uint csize, bucket, hashnr;
   LOCK *node, * volatile *el, *blocker;
   LF_PINS *pins= lo->pins;
-  enum lock_type old_lock;
+  enum lockman_lock_type old_lock;
 
   DBUG_ASSERT(lo->loid);
   lf_rwlock_by_pins(pins);
diff --git a/storage/maria/lockman.h b/storage/maria/lockman.h
index 279a5537f76..82ab483896f 100644
--- a/storage/maria/lockman.h
+++ b/storage/maria/lockman.h
@@ -31,7 +31,7 @@
   SLX  - Shared + Loose eXclusive
   LSIX - Loose Shared + Intention eXclusive
 */
-enum lock_type { N, S, X, IS, IX, SIX, LS, LX, SLX, LSIX, LOCK_TYPE_LAST };
+enum lockman_lock_type { N, S, X, IS, IX, SIX, LS, LX, SLX, LSIX, LOCK_TYPE_LAST };
 
 struct lockman_lock;
 
@@ -66,7 +66,7 @@ void lockman_init(LOCKMAN *, loid_to_lo_func *, uint);
 void lockman_destroy(LOCKMAN *);
 enum lockman_getlock_result lockman_getlock(LOCKMAN *lm, LOCK_OWNER *lo,
                                             uint64 resource,
-                                            enum lock_type lock);
+                                            enum lockman_lock_type lock);
 int lockman_release_locks(LOCKMAN *, LOCK_OWNER *);
 
 #ifdef EXTRA_DEBUG
diff --git a/storage/maria/tablockman.c b/storage/maria/tablockman.c
index eb8da1d6865..1fd9ed6ec72 100644
--- a/storage/maria/tablockman.c
+++ b/storage/maria/tablockman.c
@@ -162,7 +162,7 @@ static const int lock_compatibility_matrix[10][10]=
 
   One should never get N from it, we assert the impossibility
 */
-static const enum lock_type lock_combining_matrix[10][10]=
+static const enum lockman_lock_type lock_combining_matrix[10][10]=
 {/*    N    S   X    IS    IX  SIX    LS    LX   SLX   LSIX         */
   {    N,   N,  N,    N,    N,   N,    N,    N,   N,    N}, /* N    */
   {    N,   S,  X,    S,  SIX, SIX,    S,  SLX, SLX,  SIX}, /* S    */
@@ -269,13 +269,13 @@ void remove_from_wait_queue(TABLE_LOCK *lock, LOCKED_TABLE *table)
 */
 enum lockman_getlock_result
 tablockman_getlock(TABLOCKMAN *lm, TABLE_LOCK_OWNER *lo,
-                   LOCKED_TABLE *table, enum lock_type lock)
+                   LOCKED_TABLE *table, enum lockman_lock_type lock)
 {
   TABLE_LOCK *old, *new, *blocker, *blocker2;
   TABLE_LOCK_OWNER *wait_for;
   ulonglong deadline;
   struct timespec timeout;
-  enum lock_type new_lock;
+  enum lockman_lock_type new_lock;
   enum lockman_getlock_result res;
   int i;
 
diff --git a/storage/maria/tablockman.h b/storage/maria/tablockman.h
index 58c852b5a21..e33d1aa44e8 100644
--- a/storage/maria/tablockman.h
+++ b/storage/maria/tablockman.h
@@ -33,7 +33,7 @@
 */
 #ifndef _lockman_h
 /* QQ: TODO remove N-locks */
-enum lock_type { N, S, X, IS, IX, SIX, LS, LX, SLX, LSIX, LOCK_TYPE_LAST };
+enum lockman_lock_type { N, S, X, IS, IX, SIX, LS, LX, SLX, LSIX, LOCK_TYPE_LAST };
 enum lockman_getlock_result {
   NO_MEMORY_FOR_LOCK=1, DEADLOCK, LOCK_TIMEOUT,
   GOT_THE_LOCK,
@@ -74,7 +74,7 @@ typedef struct {
 void tablockman_init(TABLOCKMAN *, loid_to_tlo_func *, uint);
 void tablockman_destroy(TABLOCKMAN *);
 enum lockman_getlock_result tablockman_getlock(TABLOCKMAN *, TABLE_LOCK_OWNER *,
-                                               LOCKED_TABLE *, enum lock_type);
+                                               LOCKED_TABLE *, enum lockman_lock_type);
 void tablockman_release_locks(TABLOCKMAN *, TABLE_LOCK_OWNER *);
 void tablockman_init_locked_table(LOCKED_TABLE *, int);
 void tablockman_destroy_locked_table(LOCKED_TABLE *);
diff --git a/storage/maria/unittest/lockman-t.c b/storage/maria/unittest/lockman-t.c
index 8c0f71175e7..b36cc2926c5 100644
--- a/storage/maria/unittest/lockman-t.c
+++ b/storage/maria/unittest/lockman-t.c
@@ -157,7 +157,7 @@ pthread_mutex_t rt_mutex;
 int Nrows= 100;
 int Ntables= 10;
 int table_lock_ratio= 10;
-enum lock_type lock_array[6]= {S, X, LS, LX, IS, IX};
+enum lockman_lock_type lock_array[6]= {S, X, LS, LX, IS, IX};
 char *lock2str[6]= {"S", "X", "LS", "LX", "IS", "IX"};
 char *res2str[4]= {
   "DIDN'T GET THE LOCK",
diff --git a/storage/maria/unittest/lockman1-t.c b/storage/maria/unittest/lockman1-t.c
index 41a1f0fd2f4..7f6196af9ff 100644
--- a/storage/maria/unittest/lockman1-t.c
+++ b/storage/maria/unittest/lockman1-t.c
@@ -166,7 +166,7 @@ pthread_mutex_t rt_mutex;
 int Nrows= 100;
 int Ntables= 10;
 int table_lock_ratio= 10;
-enum lock_type lock_array[6]= {S, X, LS, LX, IS, IX};
+enum lockman_lock_type lock_array[6]= {S, X, LS, LX, IS, IX};
 char *lock2str[6]= {"S", "X", "LS", "LX", "IS", "IX"};
 char *res2str[]= {
   "DIDN'T GET THE LOCK",
diff --git a/storage/maria/unittest/lockman2-t.c b/storage/maria/unittest/lockman2-t.c
index c00e2695a77..584c63b4537 100644
--- a/storage/maria/unittest/lockman2-t.c
+++ b/storage/maria/unittest/lockman2-t.c
@@ -193,7 +193,7 @@ pthread_mutex_t rt_mutex;
 int Nrows= 100;
 int Ntables= 10;
 int table_lock_ratio= 10;
-enum lock_type lock_array[6]= {S, X, LS, LX, IS, IX};
+enum lockman_lock_type lock_array[6]= {S, X, LS, LX, IS, IX};
 const char *lock2str[6]= {"S", "X", "LS", "LX", "IS", "IX"};
 const char *res2str[]= {
   0,
-- 
2.30.9