mirror of
https://github.com/samba-team/samba.git
synced 2025-01-25 06:04:04 +03:00
s3:printing: Fix size types
This fixes compilation with -Wstrict-overflow=2. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
06940155f3
commit
0459a2968f
@ -63,7 +63,7 @@ enum {LPSTAT_OK, LPSTAT_STOPPED, LPSTAT_ERROR};
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
fstring message;
|
fstring message;
|
||||||
int qcount;
|
size_t qcount;
|
||||||
int status;
|
int status;
|
||||||
} print_status_struct;
|
} print_status_struct;
|
||||||
|
|
||||||
|
@ -991,7 +991,7 @@ static void print_unix_job(struct tevent_context *ev,
|
|||||||
|
|
||||||
struct traverse_struct {
|
struct traverse_struct {
|
||||||
print_queue_struct *queue;
|
print_queue_struct *queue;
|
||||||
int qcount, snum, maxcount, total_jobs;
|
size_t qcount, snum, maxcount, total_jobs;
|
||||||
const char *sharename;
|
const char *sharename;
|
||||||
time_t lpq_time;
|
time_t lpq_time;
|
||||||
const char *lprm_command;
|
const char *lprm_command;
|
||||||
@ -1010,7 +1010,7 @@ static int traverse_fn_delete(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void
|
|||||||
struct traverse_struct *ts = (struct traverse_struct *)state;
|
struct traverse_struct *ts = (struct traverse_struct *)state;
|
||||||
struct printjob pjob;
|
struct printjob pjob;
|
||||||
uint32_t jobid;
|
uint32_t jobid;
|
||||||
int i = 0;
|
size_t i = 0;
|
||||||
|
|
||||||
if ( key.dsize != sizeof(jobid) )
|
if ( key.dsize != sizeof(jobid) )
|
||||||
return 0;
|
return 0;
|
||||||
@ -1408,7 +1408,7 @@ static void print_queue_update_internal(struct tevent_context *ev,
|
|||||||
struct printif *current_printif,
|
struct printif *current_printif,
|
||||||
char *lpq_command, char *lprm_command)
|
char *lpq_command, char *lprm_command)
|
||||||
{
|
{
|
||||||
int i, qcount;
|
size_t i, qcount;
|
||||||
print_queue_struct *queue = NULL;
|
print_queue_struct *queue = NULL;
|
||||||
print_status_struct status;
|
print_status_struct status;
|
||||||
print_status_struct old_status;
|
print_status_struct old_status;
|
||||||
@ -1443,8 +1443,10 @@ static void print_queue_update_internal(struct tevent_context *ev,
|
|||||||
current_printif->type,
|
current_printif->type,
|
||||||
lpq_command, &queue, &status);
|
lpq_command, &queue, &status);
|
||||||
|
|
||||||
DEBUG(3, ("print_queue_update_internal: %d job%s in queue for %s\n",
|
DBG_NOTICE("%zu job%s in queue for %s\n",
|
||||||
qcount, (qcount != 1) ? "s" : "", sharename));
|
qcount,
|
||||||
|
(qcount != 1) ? "s" : "",
|
||||||
|
sharename);
|
||||||
|
|
||||||
/* Sort the queue by submission time otherwise they are displayed
|
/* Sort the queue by submission time otherwise they are displayed
|
||||||
in hash order. */
|
in hash order. */
|
||||||
@ -1519,15 +1521,20 @@ static void print_queue_update_internal(struct tevent_context *ev,
|
|||||||
SAFE_FREE(tstruct.queue);
|
SAFE_FREE(tstruct.queue);
|
||||||
talloc_free(tmp_ctx);
|
talloc_free(tmp_ctx);
|
||||||
|
|
||||||
DEBUG(10,("print_queue_update_internal: printer %s INFO/total_jobs = %d\n",
|
DBG_DEBUG("printer %s INFO, total_jobs = %zu\n",
|
||||||
sharename, tstruct.total_jobs ));
|
sharename,
|
||||||
|
tstruct.total_jobs);
|
||||||
|
|
||||||
tdb_store_int32(pdb->tdb, "INFO/total_jobs", tstruct.total_jobs);
|
tdb_store_int32(pdb->tdb, "INFO/total_jobs", tstruct.total_jobs);
|
||||||
|
|
||||||
get_queue_status(sharename, &old_status);
|
get_queue_status(sharename, &old_status);
|
||||||
if (old_status.qcount != qcount)
|
if (old_status.qcount != qcount) {
|
||||||
DEBUG(10,("print_queue_update_internal: queue status change %d jobs -> %d jobs for printer %s\n",
|
DBG_DEBUG("Queue status change %zu jobs -> %zu jobs "
|
||||||
old_status.qcount, qcount, sharename));
|
"for printer %s\n",
|
||||||
|
old_status.qcount,
|
||||||
|
qcount,
|
||||||
|
sharename);
|
||||||
|
}
|
||||||
|
|
||||||
/* store the new queue status structure */
|
/* store the new queue status structure */
|
||||||
slprintf(keystr, sizeof(keystr)-1, "STATUS/%s", sharename);
|
slprintf(keystr, sizeof(keystr)-1, "STATUS/%s", sharename);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user