diff options
author | Michael R Sweet <michael.r.sweet@gmail.com> | 2019-06-13 16:39:34 -0400 |
---|---|---|
committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2019-06-13 16:39:34 -0400 |
commit | 8ef4f507d7b7205014efa038e9c13d87301db845 (patch) | |
tree | f7be5358881f13e4901af68f788ea92ea7600d58 /scheduler | |
parent | 3001a140d6fcb98946b1303182dc935de7330126 (diff) | |
download | cups-8ef4f507d7b7205014efa038e9c13d87301db845.tar.gz |
Eliminate new GCC compiler warnings (Issue #5591)
Diffstat (limited to 'scheduler')
-rw-r--r-- | scheduler/ipp.c | 35 | ||||
-rw-r--r-- | scheduler/job.c | 2 | ||||
-rw-r--r-- | scheduler/printers.c | 2 | ||||
-rw-r--r-- | scheduler/subscriptions.c | 76 |
4 files changed, 36 insertions, 79 deletions
diff --git a/scheduler/ipp.c b/scheduler/ipp.c index d519b85c0..a38559751 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -1902,18 +1902,14 @@ add_job(cupsd_client_t *con, /* I - Client connection */ * Fill in the response info... */ - httpAssembleURIf(HTTP_URI_CODING_ALL, job_uri, sizeof(job_uri), "ipp", NULL, - con->clientname, con->clientport, "/jobs/%d", job->id); - ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI, "job-uri", NULL, - job_uri); + httpAssembleURIf(HTTP_URI_CODING_ALL, job_uri, sizeof(job_uri), "ipp", NULL, con->clientname, con->clientport, "/jobs/%d", job->id); + ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI, "job-uri", NULL, job_uri); ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-id", job->id); - ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_ENUM, "job-state", - job->state_value); + ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_ENUM, "job-state", (int)job->state_value); ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_TEXT, "job-state-message", NULL, ""); - ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-state-reasons", - NULL, job->reasons->values[0].string.text); + ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-state-reasons", NULL, job->reasons->values[0].string.text); con->response->request.status.status_code = IPP_OK; @@ -3283,7 +3279,7 @@ cancel_all_jobs(cupsd_client_t *con, /* I - Client connection */ * Cancel all jobs on all printers... */ - cupsdCancelJobs(NULL, username, purge); + cupsdCancelJobs(NULL, username, purge != CUPSD_JOB_DEFAULT); cupsdLogMessage(CUPSD_LOG_INFO, "All jobs were %s by \"%s\".", purge == CUPSD_JOB_PURGE ? "purged" : "canceled", @@ -3342,7 +3338,7 @@ cancel_all_jobs(cupsd_client_t *con, /* I - Client connection */ * Cancel all of the jobs on the named printer... */ - cupsdCancelJobs(printer->name, username, purge); + cupsdCancelJobs(printer->name, username, purge != CUPSD_JOB_DEFAULT); cupsdLogMessage(CUPSD_LOG_INFO, "All jobs on \"%s\" were %s by \"%s\".", printer->name, @@ -3998,8 +3994,7 @@ close_job(cupsd_client_t *con, /* I - Client connection */ ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-id", job->id); - ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_ENUM, "job-state", - job->state_value); + ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_ENUM, "job-state", (int)job->state_value); con->response->request.status.status_code = IPP_OK; @@ -4965,7 +4960,7 @@ copy_printer_attrs( ippAddString(con->response, IPP_TAG_PRINTER, IPP_TAG_NAME, "printer-op-policy", NULL, printer->op_policy); if (!ra || cupsArrayFind(ra, "printer-state")) - ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_ENUM, "printer-state", printer->state); + ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_ENUM, "printer-state", (int)printer->state); if (!ra || cupsArrayFind(ra, "printer-state-change-date-time")) ippAddDate(con->response, IPP_TAG_PRINTER, "printer-state-change-date-time", ippTimeToDate(printer->state_time)); @@ -5510,7 +5505,7 @@ create_local_printer( add_printer_attributes: ippAddBoolean(con->response, IPP_TAG_PRINTER, "printer-is-accepting-jobs", (char)printer->accepting); - ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_ENUM, "printer-state", printer->state); + ippAddInteger(con->response, IPP_TAG_PRINTER, IPP_TAG_ENUM, "printer-state", (int)printer->state); add_printer_state_reasons(con, printer); httpAssembleURIf(HTTP_URI_CODING_ALL, uri, sizeof(uri), httpIsEncrypted(con->http) ? "ipps" : "ipp", NULL, con->clientname, con->clientport, "/printers/%s", printer->name); @@ -9947,17 +9942,13 @@ send_document(cupsd_client_t *con, /* I - Client connection */ * Fill in the response info... */ - httpAssembleURIf(HTTP_URI_CODING_ALL, job_uri, sizeof(job_uri), "ipp", NULL, - con->clientname, con->clientport, "/jobs/%d", jobid); - ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI, "job-uri", NULL, - job_uri); + httpAssembleURIf(HTTP_URI_CODING_ALL, job_uri, sizeof(job_uri), "ipp", NULL, con->clientname, con->clientport, "/jobs/%d", jobid); + ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI, "job-uri", NULL, job_uri); ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_INTEGER, "job-id", jobid); - ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_ENUM, "job-state", - job->state_value); - ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-state-reasons", - NULL, job->reasons->values[0].string.text); + ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_ENUM, "job-state", (int)job->state_value); + ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_KEYWORD, "job-state-reasons", NULL, job->reasons->values[0].string.text); con->response->request.status.status_code = IPP_OK; diff --git a/scheduler/job.c b/scheduler/job.c index 6b2f3e708..4e8990fe5 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -2577,7 +2577,7 @@ cupsdSetJobState( job->state_value = newstate; if (job->state) - job->state->values[0].integer = newstate; + job->state->values[0].integer = (int)newstate; switch (newstate) { diff --git a/scheduler/printers.c b/scheduler/printers.c index e4841c071..3fb46dc89 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -4586,7 +4586,7 @@ load_ppd(cupsd_printer_t *p) /* I - Printer */ for (fin = (_pwg_finishings_t *)cupsArrayFirst(p->pc->finishings); fin; fin = (_pwg_finishings_t *)cupsArrayNext(p->pc->finishings)) { if (num_finishings < (int)(sizeof(finishings) / sizeof(finishings[0]))) - finishings[num_finishings++] = fin->value; + finishings[num_finishings++] = (int)fin->value; switch (fin->value) { diff --git a/scheduler/subscriptions.c b/scheduler/subscriptions.c index 0908f3c0c..ecd6334c4 100644 --- a/scheduler/subscriptions.c +++ b/scheduler/subscriptions.c @@ -163,27 +163,18 @@ cupsdAddEvent( * Add printer attributes... */ - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_URI, - "notify-printer-uri", NULL, dest->uri); + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_URI, "notify-printer-uri", NULL, dest->uri); - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_NAME, - "printer-name", NULL, dest->name); + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_NAME, "printer-name", NULL, dest->name); - ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_ENUM, - "printer-state", dest->state); + ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_ENUM, "printer-state", (int)dest->state); if (dest->num_reasons == 0) - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, - IPP_TAG_KEYWORD, "printer-state-reasons", NULL, - dest->state == IPP_PRINTER_STOPPED ? "paused" : "none"); + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD, "printer-state-reasons", NULL, dest->state == IPP_PRINTER_STOPPED ? "paused" : "none"); else - ippAddStrings(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, - IPP_TAG_KEYWORD, "printer-state-reasons", - dest->num_reasons, NULL, - (const char * const *)dest->reasons); + ippAddStrings(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD, "printer-state-reasons", dest->num_reasons, NULL, (const char * const *)dest->reasons); - ippAddBoolean(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, - "printer-is-accepting-jobs", (char)dest->accepting); + ippAddBoolean(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, "printer-is-accepting-jobs", (char)dest->accepting); } if (job) @@ -192,75 +183,51 @@ cupsdAddEvent( * Add job attributes... */ - ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER, - "notify-job-id", job->id); - ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_ENUM, - "job-state", job->state_value); + ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER, "notify-job-id", job->id); + ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_ENUM, "job-state", (int)job->state_value); - if ((attr = ippFindAttribute(job->attrs, "job-name", - IPP_TAG_NAME)) != NULL) - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_NAME, - "job-name", NULL, attr->values[0].string.text); + if ((attr = ippFindAttribute(job->attrs, "job-name", IPP_TAG_NAME)) != NULL) + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_NAME, "job-name", NULL, attr->values[0].string.text); switch (job->state_value) { case IPP_JOB_PENDING : if (dest && dest->state == IPP_PRINTER_STOPPED) - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, - IPP_TAG_KEYWORD, "job-state-reasons", NULL, - "printer-stopped"); + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD, "job-state-reasons", NULL, "printer-stopped"); else - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, - IPP_TAG_KEYWORD, "job-state-reasons", NULL, - "none"); + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD, "job-state-reasons", NULL, "none"); break; case IPP_JOB_HELD : if (ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_KEYWORD) != NULL || ippFindAttribute(job->attrs, "job-hold-until", IPP_TAG_NAME) != NULL) - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, - IPP_TAG_KEYWORD, "job-state-reasons", NULL, - "job-hold-until-specified"); + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD, "job-state-reasons", NULL, "job-hold-until-specified"); else - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, - IPP_TAG_KEYWORD, "job-state-reasons", NULL, - "job-incoming"); + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD, "job-state-reasons", NULL, "job-incoming"); break; case IPP_JOB_PROCESSING : - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, - IPP_TAG_KEYWORD, "job-state-reasons", NULL, - "job-printing"); + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD, "job-state-reasons", NULL, "job-printing"); break; case IPP_JOB_STOPPED : - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, - IPP_TAG_KEYWORD, "job-state-reasons", NULL, - "job-stopped"); + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD, "job-state-reasons", NULL, "job-stopped"); break; case IPP_JOB_CANCELED : - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, - IPP_TAG_KEYWORD, "job-state-reasons", NULL, - "job-canceled-by-user"); + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD, "job-state-reasons", NULL, "job-canceled-by-user"); break; case IPP_JOB_ABORTED : - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, - IPP_TAG_KEYWORD, "job-state-reasons", NULL, - "aborted-by-system"); + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD, "job-state-reasons", NULL, "aborted-by-system"); break; case IPP_JOB_COMPLETED : - ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, - IPP_TAG_KEYWORD, "job-state-reasons", NULL, - "job-completed-successfully"); + ippAddString(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_KEYWORD, "job-state-reasons", NULL, "job-completed-successfully"); break; } - ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER, - "job-impressions-completed", - job->sheets ? job->sheets->values[0].integer : 0); + ippAddInteger(temp->attrs, IPP_TAG_EVENT_NOTIFICATION, IPP_TAG_INTEGER, "job-impressions-completed", job->sheets ? job->sheets->values[0].integer : 0); } /* @@ -274,8 +241,7 @@ cupsdAddEvent( if (temp) cupsdMarkDirty(CUPSD_DIRTY_SUBSCRIPTIONS); else - cupsdLogMessage(CUPSD_LOG_DEBUG, "Discarding unused %s event...", - cupsdEventName(event)); + cupsdLogMessage(CUPSD_LOG_DEBUG, "Discarding unused %s event...", cupsdEventName(event)); } |