]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix signed/unsigned build warnings
authorKinsey Moore <kmoore@digium.com>
Fri, 23 May 2014 14:35:00 +0000 (14:35 +0000)
committerKinsey Moore <kmoore@digium.com>
Fri, 23 May 2014 14:35:00 +0000 (14:35 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@414474 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_pjsip.c
main/bridge.c
main/event.c
res/parking/parking_bridge.c
res/parking/parking_bridge_features.c
res/parking/parking_manager.c
res/res_pjsip/config_transport.c
res/res_pjsip_refer.c
res/res_pjsip_sdp_rtp.c

index 8d347e7a069208ef3054d4e6d6fbad020d758098..4876f02a4b1b3d16e621427bce6a023ece2c4ce3 100644 (file)
@@ -361,7 +361,7 @@ static struct ast_channel *chan_pjsip_new(struct ast_sip_session *session, int s
        }
 
        if (!(chan = ast_channel_alloc(1, state, S_OR(session->id.number.str, ""), S_OR(session->id.name.str, ""), "", "", "", assignedids, requestor, 0, "PJSIP/%s-%08x", ast_sorcery_object_get_id(session->endpoint),
-               ast_atomic_fetchadd_int((int *)&chan_idx, +1)))) {
+               (unsigned)ast_atomic_fetchadd_int((int *)&chan_idx, +1)))) {
                return NULL;
        }
 
@@ -638,7 +638,7 @@ static int chan_pjsip_write(struct ast_channel *ast, struct ast_frame *frame)
        case AST_FRAME_MODEM:
                break;
        default:
-               ast_log(LOG_WARNING, "Can't send %d type frames with PJSIP\n", frame->frametype);
+               ast_log(LOG_WARNING, "Can't send %u type frames with PJSIP\n", frame->frametype);
                break;
        }
 
index e8ac81864201cb3377290122d647ade3dfb5b1ef..fa4e3c699c5cd949053e04e8fd0e892ca62b478a 100644 (file)
@@ -268,7 +268,7 @@ int ast_bridge_technology_unregister(struct ast_bridge_technology *technology)
  */
 static void bridge_queue_action_nodup(struct ast_bridge *bridge, struct ast_frame *action)
 {
-       ast_debug(1, "Bridge %s: queueing action type:%d sub:%d\n",
+       ast_debug(1, "Bridge %s: queueing action type:%u sub:%d\n",
                bridge->uniqueid, action->frametype, action->subclass.integer);
 
        ast_bridge_lock(bridge);
@@ -487,7 +487,7 @@ static struct ast_bridge_technology *find_best_technology(uint32_t capabilities,
                        continue;
                }
                if (best && current->preference <= best->preference) {
-                       ast_debug(1, "Bridge technology %s has less preference than %s (%d <= %d). Skipping.\n",
+                       ast_debug(1, "Bridge technology %s has less preference than %s (%u <= %u). Skipping.\n",
                                current->name, best->name, current->preference, best->preference);
                        continue;
                }
@@ -3144,7 +3144,7 @@ int ast_bridge_features_enable(struct ast_bridge_features *features,
                dtmf = builtin_features_dtmf[feature];
                /* If no DTMF is still available (ie: it has been disabled) then error out now */
                if (ast_strlen_zero(dtmf)) {
-                       ast_debug(1, "Failed to enable built in feature %d on %p, no DTMF string is available for it.\n",
+                       ast_debug(1, "Failed to enable built in feature %u on %p, no DTMF string is available for it.\n",
                                feature, features);
                        return -1;
                }
@@ -4944,7 +4944,7 @@ static const char *tech_capability2str(uint32_t capabilities)
 static char *handle_bridge_technology_show(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 #define FORMAT_HDR "%-20s %-20s %8s %s\n"
-#define FORMAT_ROW "%-20s %-20s %8d %s\n"
+#define FORMAT_ROW "%-20s %-20s %8u %s\n"
 
        struct ast_bridge_technology *cur;
 
@@ -5131,7 +5131,7 @@ static int manager_bridge_tech_list(struct mansession *s, const struct message *
                        "Event: BridgeTechnologyListItem\r\n"
                        "BridgeTechnology: %s\r\n"
                        "BridgeType: %s\r\n"
-                       "BridgePriority: %d\r\n"
+                       "BridgePriority: %u\r\n"
                        "BridgeSuspended: %s\r\n"
                        "%s"
                        "\r\n",
@@ -5167,7 +5167,7 @@ static void bridge_prnt_obj(void *v_obj, void *where, ao2_prnt_fn *prnt)
        if (!bridge) {
                return;
        }
-       prnt(where, "%s %s chans:%d",
+       prnt(where, "%s %s chans:%u",
                bridge->uniqueid, bridge->v_table->name, bridge->num_channels);
 }
 
index 876e53b88f0f80ff2002215c7f411d0a2df8c92f..35076ec94aad4644274613c319810181880f4cf3 100644 (file)
@@ -200,7 +200,7 @@ const char *ast_event_get_type_name(const struct ast_event *event)
        type = ast_event_get_type(event);
 
        if (type < 0 || type >= ARRAY_LEN(event_names)) {
-               ast_log(LOG_ERROR, "Invalid event type - '%d'\n", type);
+               ast_log(LOG_ERROR, "Invalid event type - '%u'\n", type);
                return "";
        }
 
index e1fd5f8fe7ef6508d081f46300fb28a7748fb5dc..4f7198b4fad7471303eaebed457f2619bfea93de 100644 (file)
@@ -304,7 +304,7 @@ static int bridge_parking_push(struct ast_bridge_parking *self, struct ast_bridg
        if (!strcmp(blind_transfer, ast_channel_name(bridge_channel->chan)) && !park_datastore->silence_announce) {
                char saynum_buf[16];
 
-               snprintf(saynum_buf, sizeof(saynum_buf), "%u %u", 0, pu->parking_space);
+               snprintf(saynum_buf, sizeof(saynum_buf), "%d %d", 0, pu->parking_space);
                ast_bridge_channel_queue_playfile(bridge_channel, say_parking_space, saynum_buf, NULL);
        }
 
index a48b14ef619fd63e79b0c2226d404c37e7e8baef..f411d041642c33a1f2add32dc6fdf07627ae5c84 100644 (file)
@@ -118,7 +118,7 @@ static void parker_parked_call_message_response(struct ast_parked_call_payload *
         * parked_subscription_data is tracking a transfer_channel_data struct. */
        if (message->event_type == PARKED_CALL) {
                /* queue the saynum on the bridge channel and hangup */
-               snprintf(saynum_buf, sizeof(saynum_buf), "%u %u", data->hangup_after, message->parkingspace);
+               snprintf(saynum_buf, sizeof(saynum_buf), "%d %u", data->hangup_after, message->parkingspace);
                if (!data->transfer_data) {
                        ast_bridge_channel_queue_playfile(bridge_channel, say_parking_space, saynum_buf, NULL);
                } else {
@@ -664,7 +664,7 @@ void say_parking_space(struct ast_bridge_channel *bridge_channel, const char *pa
        int numeric_value;
        int hangup_after;
 
-       if (sscanf(payload, "%u %u", &hangup_after, &numeric_value) != 2) {
+       if (sscanf(payload, "%d %d", &hangup_after, &numeric_value) != 2) {
                /* If say_parking_space is called with a non-numeric string, we have a problem. */
                ast_assert(0);
                ast_bridge_channel_leave_bridge(bridge_channel,
index 55ce85a3544ca5cca8c576a3feb1ac3ea0644629..92854feb2cfda3a5e4abc1c2c23f7cb4f28119ef 100644 (file)
@@ -389,7 +389,7 @@ static int manager_append_event_parking_lot_data_cb(void *obj, void *arg, void *
                "Name: %s\r\n"
                "StartSpace: %d\r\n"
                "StopSpace: %d\r\n"
-               "Timeout: %d\r\n"
+               "Timeout: %u\r\n"
                "%s" /* The Action ID */
                "\r\n",
                curlot->name,
index ce57ab6dea6a58612f3bbe650c236a598f20dbce..22581ca52a275d6b4a7193e82cb5db2193f4373a 100644 (file)
@@ -519,7 +519,7 @@ static int transport_tos_handler(const struct aco_option *opt, struct ast_variab
                value = value << 2;
                ast_log(LOG_WARNING,
                        "transport '%s' - 'tos' value '%s' uses bits that are "
-                       "discarded when converted to DSCP. Using equivalent %d instead.\n",
+                       "discarded when converted to DSCP. Using equivalent %u instead.\n",
                        ast_sorcery_object_get_id(transport), var->value, value);
        }
 
@@ -531,7 +531,7 @@ static int tos_to_str(const void *obj, const intptr_t *args, char **buf)
 {
        const struct ast_sip_transport *transport = obj;
 
-       if (ast_asprintf(buf, "%d", transport->tos) == -1) {
+       if (ast_asprintf(buf, "%u", transport->tos) == -1) {
                return -1;
        }
        return 0;
@@ -605,7 +605,7 @@ static int cli_print_body(void *obj, void *arg, int flags)
 
        pj_sockaddr_print(&transport->host, hoststr, sizeof(hoststr), 3);
 
-       ast_str_append(&context->output_buffer, 0, "%*s:  %-21s  %6s  %5d  %5d  %s\n",
+       ast_str_append(&context->output_buffer, 0, "%*s:  %-21s  %6s  %5u  %5u  %s\n",
                CLI_INDENT_TO_SPACES(context->indent_level), "Transport",
                ast_sorcery_object_get_id(transport),
                ARRAY_IN_BOUNDS(transport->type, transport_types) ? transport_types[transport->type] : "Unknown",
index 46f504542e29eda247776aaf57b24902d92eb8d5..ab27f0b0cbb8a9469454e7f276be7e4479de85b9 100644 (file)
@@ -112,7 +112,7 @@ static int refer_progress_notify(void *data)
 
        /* If the subscription has already been terminated we can't send a notification */
        if (!(sub = notification->progress->sub)) {
-               ast_debug(3, "Not sending NOTIFY of response '%d' and state '%d' on progress monitor '%p' as subscription has been terminated\n",
+               ast_debug(3, "Not sending NOTIFY of response '%d' and state '%u' on progress monitor '%p' as subscription has been terminated\n",
                        notification->response, notification->state, notification->progress);
                return 0;
        }
@@ -133,7 +133,7 @@ static int refer_progress_notify(void *data)
                notification->progress->sub = NULL;
        }
 
-       ast_debug(3, "Sending NOTIFY with response '%d' and state '%d' on subscription '%p' and progress monitor '%p'\n",
+       ast_debug(3, "Sending NOTIFY with response '%d' and state '%u' on subscription '%p' and progress monitor '%p'\n",
                notification->response, notification->state, sub, notification->progress);
 
        /* Actually send the notification */
index 0e3557b990198ea79da9e368758b845669211f95..43f0832acfc1a14a5d1c1f52cc544a164b4fa95c 100644 (file)
@@ -348,7 +348,7 @@ static void add_ice_to_stream(struct ast_sip_session *session, struct ast_sip_se
        for (; (candidate = ao2_iterator_next(&it_candidates)); ao2_ref(candidate, -1)) {
                struct ast_str *attr_candidate = ast_str_create(128);
 
-               ast_str_set(&attr_candidate, -1, "%s %d %s %d %s ", candidate->foundation, candidate->id, candidate->transport,
+               ast_str_set(&attr_candidate, -1, "%s %u %s %d %s ", candidate->foundation, candidate->id, candidate->transport,
                                        candidate->priority, ast_sockaddr_stringify_host(&candidate->address));
                ast_str_append(&attr_candidate, -1, "%s typ ", ast_sockaddr_stringify_port(&candidate->address));
 
@@ -409,7 +409,7 @@ static void process_ice_attributes(struct ast_sip_session *session, struct ast_s
        /* Find all of the candidates */
        for (attr_i = 0; attr_i < remote_stream->attr_count; ++attr_i) {
                char foundation[32], transport[32], address[PJ_INET6_ADDRSTRLEN + 1], cand_type[6], relay_address[PJ_INET6_ADDRSTRLEN + 1] = "";
-               int port, relay_port = 0;
+               unsigned int port, relay_port = 0;
                struct ast_rtp_engine_ice_candidate candidate = { 0, };
 
                attr = remote_stream->attr[attr_i];
@@ -422,7 +422,7 @@ static void process_ice_attributes(struct ast_sip_session *session, struct ast_s
                ast_copy_pj_str(attr_value, (pj_str_t*)&attr->value, sizeof(attr_value));
 
                if (sscanf(attr_value, "%31s %30u %31s %30u %46s %30u typ %5s %*s %23s %*s %30u", foundation, &candidate.id, transport,
-                       &candidate.priority, address, &port, cand_type, relay_address, &relay_port) < 7) {
+                       (unsigned *)&candidate.priority, address, &port, cand_type, relay_address, &relay_port) < 7) {
                        /* Candidate did not parse properly */
                        continue;
                }