Fix Solaris build
[exim.git] / src / src / lookups / lf_sqlperform.c
index d430cd454a27fc7439359fec6d20ea3744a1f9b3..cc894e0ed89083725d8f59198de7e2d58e8feaf4 100644 (file)
@@ -2,7 +2,7 @@
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
 *     Exim - an Internet mail transport agent    *
 *************************************************/
 
-/* Copyright (c) University of Cambridge 1995 - 2009 */
+/* Copyright (c) University of Cambridge 1995 - 2018 */
 /* See the file NOTICE for conditions of use and distribution. */
 
 
 /* See the file NOTICE for conditions of use and distribution. */
 
 
@@ -27,24 +27,25 @@ Arguments:
   query          the query
   result         where to pass back the result
   errmsg         where to pass back an error message
   query          the query
   result         where to pass back the result
   errmsg         where to pass back an error message
-  do_cache       to be set FALSE if data is changed
+  do_cache       to be set zero if data is changed
   func           the lookup function to call
 
 Returns:         the return from the lookup function, or DEFER
 */
 
 int
   func           the lookup function to call
 
 Returns:         the return from the lookup function, or DEFER
 */
 
 int
-lf_sqlperform(uschar *name, uschar *optionname, uschar *optserverlist,
-  uschar *query, uschar **result, uschar **errmsg, BOOL *do_cache,
-  int(*fn)(uschar *, uschar *, uschar **, uschar **, BOOL *, BOOL *))
+lf_sqlperform(const uschar *name, const uschar *optionname,
+  const uschar *optserverlist, const uschar *query,
+  uschar **result, uschar **errmsg, uint *do_cache,
+  int(*fn)(const uschar *, uschar *, uschar **, uschar **, BOOL *, uint *))
 {
 int sep, rc;
 uschar *server;
 {
 int sep, rc;
 uschar *server;
-uschar *serverlist;
+const uschar *serverlist;
 uschar buffer[512];
 BOOL defer_break = FALSE;
 
 uschar buffer[512];
 BOOL defer_break = FALSE;
 
-DEBUG(D_lookup) debug_printf("%s query: %s\n", name, query);
+DEBUG(D_lookup) debug_printf_indent("%s query: %s\n", name, query);
 
 /* Handle queries that do not have server information at the start. */
 
 
 /* Handle queries that do not have server information at the start. */
 
@@ -68,8 +69,8 @@ if (Ustrncmp(query, "servers", 7) != 0)
 else
   {
   int qsep;
 else
   {
   int qsep;
-  uschar *s, *ss;
-  uschar *qserverlist;
+  const uschar *s, *ss;
+  const uschar *qserverlist;
   uschar *qserver;
   uschar qbuffer[512];
 
   uschar *qserver;
   uschar qbuffer[512];
 
@@ -97,7 +98,7 @@ else
     return DEFER;
     }
 
     return DEFER;
     }
 
-  qserverlist = string_sprintf("%.*s", ss - s, s);
+  qserverlist = string_sprintf("%.*s", (int)(ss - s), s);
   qsep = 0;
 
   while ((qserver = string_nextinlist(&qserverlist, &qsep, qbuffer,
   qsep = 0;
 
   while ((qserver = string_nextinlist(&qserverlist, &qsep, qbuffer,