Author: vlendec
Date: 2005-03-12 09:59:13 +0000 (Sat, 12 Mar 2005)
New Revision: 5771

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5771

Log:
Get rid of some compiler warnings
Modified:
   trunk/source/printing/printing.c


Changeset:
Modified: trunk/source/printing/printing.c
===================================================================
--- trunk/source/printing/printing.c    2005-03-12 09:58:35 UTC (rev 5770)
+++ trunk/source/printing/printing.c    2005-03-12 09:59:13 UTC (rev 5771)
@@ -907,7 +907,7 @@
 
 static void store_queue_struct(struct tdb_print_db *pdb, struct 
traverse_struct *pts)
 {
-       TDB_DATA data, key;
+       TDB_DATA data;
        int max_reported_jobs = lp_max_reported_jobs(pts->snum);
        print_queue_struct *queue = pts->queue;
        size_t len;
@@ -951,22 +951,19 @@
                                queue[i].fs_file);
        }
 
-       key.dptr = "INFO/linear_queue_array";
-       key.dsize = strlen(key.dptr);
-       tdb_store(pdb->tdb, key, data, TDB_REPLACE);
+       tdb_store(pdb->tdb, string_tdb_data("INFO/linear_queue_array"), data,
+                 TDB_REPLACE);
        SAFE_FREE(data.dptr);
        return;
 }
 
 static TDB_DATA get_jobs_changed_data(struct tdb_print_db *pdb)
 {
-       TDB_DATA data, key;
+       TDB_DATA data;
 
-       key.dptr = "INFO/jobs_changed";
-       key.dsize = strlen(key.dptr);
        ZERO_STRUCT(data);
 
-       data = tdb_fetch(pdb->tdb, key);
+       data = tdb_fetch(pdb->tdb, string_tdb_data("INFO/jobs_changed"));
        if (data.dptr == NULL || data.dsize == 0 || (data.dsize % 4 != 0)) {
                SAFE_FREE(data.dptr);
                ZERO_STRUCT(data);
@@ -1736,11 +1733,11 @@
        BOOL ret = False;
        BOOL gotlock = False;
 
-       key.dptr = "INFO/jobs_changed";
-       key.dsize = strlen(key.dptr);
        ZERO_STRUCT(data);
 
-       if (tdb_chainlock_with_timeout(pdb->tdb, key, 5) == -1)
+       if (tdb_chainlock_with_timeout(pdb->tdb,
+                                      string_tdb_data("INFO/jobs_changed"),
+                                      5) == -1)
                goto out;
 
        gotlock = True;
@@ -2057,7 +2054,7 @@
 static int get_queue_status(const char* sharename, print_status_struct *status)
 {
        fstring keystr;
-       TDB_DATA data, key;
+       TDB_DATA data;
        struct tdb_print_db *pdb = get_print_db_byname(sharename);
        int len;
 
@@ -2066,10 +2063,8 @@
 
        if (status) {
                ZERO_STRUCTP(status);
-               slprintf(keystr, sizeof(keystr)-1, "STATUS/%s", sharename);
-               key.dptr = keystr;
-               key.dsize = strlen(keystr);
-               data = tdb_fetch(pdb->tdb, key);
+               fstr_sprintf(keystr, "STATUS/%s", sharename);
+               data = tdb_fetch(pdb->tdb, string_tdb_data(keystr));
                if (data.dptr) {
                        if (data.dsize == sizeof(print_status_struct))
                                /* this memcpy is ok since the status struct 
was 
@@ -2179,18 +2174,17 @@
 
 static BOOL add_to_jobs_changed(struct tdb_print_db *pdb, uint32 jobid)
 {
-       TDB_DATA data, key;
+       TDB_DATA data;
        uint32 store_jobid;
 
-       key.dptr = "INFO/jobs_changed";
-       key.dsize = strlen(key.dptr);
        SIVAL(&store_jobid, 0, jobid);
        data.dptr = (char *)&store_jobid;
        data.dsize = 4;
 
        DEBUG(10,("add_to_jobs_changed: Added jobid %u\n", (unsigned int)jobid 
));
 
-       return (tdb_append(pdb->tdb, key, data) == 0);
+       return (tdb_append(pdb->tdb, string_tdb_data("INFO/jobs_changed"),
+                          data) == 0);
 }
 
 /***************************************************************************
@@ -2429,7 +2423,7 @@
 
 static BOOL get_stored_queue_info(struct tdb_print_db *pdb, int snum, int 
*pcount, print_queue_struct **ppqueue)
 {
-       TDB_DATA data, key, cgdata;
+       TDB_DATA data, cgdata;
        print_queue_struct *queue = NULL;
        uint32 qcount = 0;
        uint32 extra_count = 0;
@@ -2449,20 +2443,15 @@
 
        ZERO_STRUCT(data);
        ZERO_STRUCT(cgdata);
-       key.dptr = "INFO/linear_queue_array";
-       key.dsize = strlen(key.dptr);
 
        /* Get the stored queue data. */
-       data = tdb_fetch(pdb->tdb, key);
+       data = tdb_fetch(pdb->tdb, string_tdb_data("INFO/linear_queue_array"));
        
        if (data.dptr && data.dsize >= sizeof(qcount))
                len += tdb_unpack(data.dptr + len, data.dsize - len, "d", 
&qcount);
                
        /* Get the changed jobs list. */
-       key.dptr = "INFO/jobs_changed";
-       key.dsize = strlen(key.dptr);
-
-       cgdata = tdb_fetch(pdb->tdb, key);
+       cgdata = tdb_fetch(pdb->tdb, string_tdb_data("INFO/jobs_changed"));
        if (cgdata.dptr != NULL && (cgdata.dsize % 4 == 0))
                extra_count = cgdata.dsize/4;
 

Reply via email to