svn commit: samba r8715 - in branches/SAMBA_4_0/source/dsdb/samdb: .
tridge at samba.org
tridge at samba.org
Fri Jul 22 11:32:01 GMT 2005
Author: tridge
Date: 2005-07-22 11:32:01 +0000 (Fri, 22 Jul 2005)
New Revision: 8715
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=8715
Log:
- revert the %PRIi64 stuff. Tim, we explicitly check for %llu support
in configure, and replace snprintf if the system doesn't support
it. Our replacement code does not handle the "%PRIi64" stuff, so
using it would break us on lots of platforms
- fixed constant array initialisers to work on HPUX.
Modified:
branches/SAMBA_4_0/source/dsdb/samdb/samdb.c
Changeset:
Modified: branches/SAMBA_4_0/source/dsdb/samdb/samdb.c
===================================================================
--- branches/SAMBA_4_0/source/dsdb/samdb/samdb.c 2005-07-22 11:19:55 UTC (rev 8714)
+++ branches/SAMBA_4_0/source/dsdb/samdb/samdb.c 2005-07-22 11:32:01 UTC (rev 8715)
@@ -88,9 +88,11 @@
const char *format, va_list ap) _PRINTF_ATTRIBUTE(5,0)
{
int count;
- const char * const attrs[2] = { attr_name, NULL };
+ const char *attrs[2] = { NULL, NULL };
struct ldb_message **res = NULL;
+ attrs[0] = attr_name;
+
count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap);
if (count > 1) {
DEBUG(1,("samdb: search for %s %s not single valued (count=%d)\n",
@@ -136,9 +138,11 @@
va_list ap;
int count;
struct ldb_message **res;
- const char * const attrs[2] = { attr_name, NULL };
+ const char *attrs[2] = { NULL, NULL };
struct dom_sid *sid;
+ attrs[0] = attr_name;
+
va_start(ap, format);
count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap);
va_end(ap);
@@ -189,8 +193,10 @@
va_list ap;
int count;
struct ldb_message **res;
- const char * const attrs[2] = { attr_name, NULL };
+ const char *attrs[2] = { NULL, NULL };
+ attrs[0] = attr_name;
+
va_start(ap, format);
count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap);
va_end(ap);
@@ -215,8 +221,10 @@
va_list ap;
int count;
struct ldb_message **res;
- const char * const attrs[2] = { attr_name, NULL };
+ const char *attrs[2] = { NULL, NULL };
+ attrs[0] = attr_name;
+
va_start(ap, format);
count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap);
va_end(ap);
@@ -241,9 +249,11 @@
{
va_list ap;
int count, i;
- const char * const attrs[2] = { attr_name, NULL };
+ const char *attrs[2] = { NULL, NULL };
struct ldb_message **res = NULL;
+ attrs[0] = attr_name;
+
va_start(ap, format);
count = gendb_search_v(sam_ldb, mem_ctx, basedn, &res, attrs, format, ap);
va_end(ap);
@@ -852,7 +862,7 @@
int samdb_msg_add_int64(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg,
const char *attr_name, int64_t v)
{
- const char *s = talloc_asprintf(mem_ctx, "%"PRIi64, v);
+ const char *s = talloc_asprintf(mem_ctx, "%lld", v);
return samdb_msg_add_string(sam_ldb, mem_ctx, msg, attr_name, s);
}
@@ -862,7 +872,7 @@
int samdb_msg_add_uint64(struct ldb_context *sam_ldb, TALLOC_CTX *mem_ctx, struct ldb_message *msg,
const char *attr_name, uint64_t v)
{
- const char *s = talloc_asprintf(mem_ctx, "%"PRIu64, v);
+ const char *s = talloc_asprintf(mem_ctx, "%llu", v);
return samdb_msg_add_string(sam_ldb, mem_ctx, msg, attr_name, s);
}
More information about the samba-cvs
mailing list