clang6: fix databases/mysqlcc

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

clang6: fix databases/mysqlcc

Theo Buehler-5
Only need to fix these two to build:

src/main.cpp:98:67: note: insert an explicit cast to silence this issue
   (uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ~0L, 0, 1, 0},
                                                                  ^~~
                                                                  static_cast<ulonglong>( )
src/main.cpp:114:71: note: insert an explicit cast to silence this issue
   (uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ~0L, 0, 1,
                                                                      ^~~
                                                                      static_cast<ulonglong>( )

Index: patches/patch-src_main_cpp
===================================================================
RCS file: patches/patch-src_main_cpp
diff -N patches/patch-src_main_cpp
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_main_cpp 16 Apr 2018 07:46:18 -0000
@@ -0,0 +1,23 @@
+$OpenBSD$
+
+Index: src/main.cpp
+--- src/main.cpp.orig
++++ src/main.cpp
+@@ -95,7 +95,7 @@ static struct my_option my_long_options[] =
+    0, (void*)1},
+
+   {"select_limit", OPT_SELECT_LIMIT, "", (uchar**) &select_limit,
+-   (uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ~0L, 0, 1, 0},
++   (uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, static_cast<ulonglong>(~0L), 0, 1, 0},
+  
+   {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "",
+    (uchar**) &my_net_buffer_length, (uchar**) &my_net_buffer_length, 0, GET_ULONG,
+@@ -111,7 +111,7 @@ static struct my_option my_long_options[] =
+    (uchar**) &opt_local_infile, 0, GET_BOOL, OPT_ARG, 0, 0, 0, 0, 0, 0},
+
+   {"max_join_size", OPT_MAX_JOIN_SIZE, "", (uchar**) &max_join_size,
+-   (uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ~0L, 0, 1,
++   (uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, static_cast<ulonglong>(~0L), 0, 1,
+    0},
+
+   { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}

Reply | Threaded
Open this post in threaded view
|

Re: clang6: fix databases/mysqlcc

Anthony J. Bentley-4
Theo Buehler writes:
> +-   (uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ~0L, 0, 1
> , 0},
> ++   (uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, static_ca
> st<ulonglong>(~0L), 0, 1, 0},

Would it make sense to use ~0ULL instead?

Reply | Threaded
Open this post in threaded view
|

Re: clang6: fix databases/mysqlcc

Theo Buehler-4
On Mon, Apr 16, 2018 at 02:22:58AM -0600, Anthony J. Bentley wrote:
> Theo Buehler writes:
> > +-   (uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ~0L, 0, 1
> > , 0},
> > ++   (uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, static_ca
> > st<ulonglong>(~0L), 0, 1, 0},
>
> Would it make sense to use ~0ULL instead?
>

Yes, I think that's better:

Index: patches/patch-src_main_cpp
===================================================================
RCS file: /cvs/ports/databases/mysqlcc/patches/patch-src_main_cpp,v
retrieving revision 1.4
diff -u -p -r1.4 patch-src_main_cpp
--- patches/patch-src_main_cpp 16 Apr 2018 08:20:10 -0000 1.4
+++ patches/patch-src_main_cpp 16 Apr 2018 08:33:25 -0000
@@ -8,7 +8,7 @@ Index: src/main.cpp
 
    {"select_limit", OPT_SELECT_LIMIT, "", (uchar**) &select_limit,
 -   (uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ~0L, 0, 1, 0},
-+   (uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, static_cast<ulonglong>(~0L), 0, 1, 0},
++   (uchar**) &select_limit, 0, GET_ULONG, REQUIRED_ARG, 1000L, 1, ~0ULL, 0, 1, 0},
   
    {"net_buffer_length", OPT_NET_BUFFER_LENGTH, "",
     (uchar**) &my_net_buffer_length, (uchar**) &my_net_buffer_length, 0, GET_ULONG,
@@ -17,7 +17,7 @@ Index: src/main.cpp
 
    {"max_join_size", OPT_MAX_JOIN_SIZE, "", (uchar**) &max_join_size,
 -   (uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ~0L, 0, 1,
-+   (uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, static_cast<ulonglong>(~0L), 0, 1,
++   (uchar**) &max_join_size, 0, GET_ULONG, REQUIRED_ARG, 1000000L, 1, ~0ULL, 0, 1,
     0},
 
    { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0}