Fix compiler warnings
This commit is contained in:
parent
76068ee2bd
commit
bf32466112
@ -161,7 +161,6 @@ matrix_http_api_set_property(GObject *gobject,
|
|||||||
GParamSpec *pspec)
|
GParamSpec *pspec)
|
||||||
{
|
{
|
||||||
MatrixHTTPAPI *api = MATRIX_HTTP_API(gobject);
|
MatrixHTTPAPI *api = MATRIX_HTTP_API(gobject);
|
||||||
MatrixHTTPAPIPrivate *priv = matrix_http_api_get_instance_private(api);
|
|
||||||
|
|
||||||
switch (prop_id) {
|
switch (prop_id) {
|
||||||
case PROP_VALIDATE_CERTIFICATE:
|
case PROP_VALIDATE_CERTIFICATE:
|
||||||
@ -807,7 +806,7 @@ _send(MatrixHTTPAPI *api,
|
|||||||
json_generator_set_root(generator, (JsonNode *)json_content);
|
json_generator_set_root(generator, (JsonNode *)json_content);
|
||||||
data = json_generator_to_data(generator, &datalen);
|
data = json_generator_to_data(generator, &datalen);
|
||||||
} else if (raw_content) {
|
} else if (raw_content) {
|
||||||
data = raw_content->data;
|
data = (gchar *)raw_content->data;
|
||||||
datalen = raw_content->len;
|
datalen = raw_content->len;
|
||||||
} else {
|
} else {
|
||||||
data = g_strdup("{}");
|
data = g_strdup("{}");
|
||||||
@ -915,7 +914,6 @@ i_create_room(MatrixAPI *api,
|
|||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
JsonNode *body;
|
JsonNode *body;
|
||||||
JsonObject *root_object;
|
|
||||||
JsonBuilder *builder;
|
JsonBuilder *builder;
|
||||||
|
|
||||||
builder = json_builder_new();
|
builder = json_builder_new();
|
||||||
@ -1247,6 +1245,9 @@ i_media_thumbnail(MatrixAPI *api,
|
|||||||
g_hash_table_replace(params, "method", g_strdup("scale"));
|
g_hash_table_replace(params, "method", g_strdup("scale"));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
// This is here to prevent compiler warnings
|
||||||
|
case MATRIX_RESIZE_METHOD_DEFAULT: break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1330,11 +1331,9 @@ i_set_user_presence(MatrixAPI *api,
|
|||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gchar *encoded_user_id;
|
gchar *encoded_user_id;
|
||||||
gchar *path, *presence_string, *a;
|
gchar *path, *presence_string;
|
||||||
JsonBuilder *builder;
|
JsonBuilder *builder;
|
||||||
JsonNode *body;
|
JsonNode *body;
|
||||||
GEnumClass *presence_class;
|
|
||||||
GEnumValue *value;
|
|
||||||
|
|
||||||
encoded_user_id = soup_uri_encode(user_id, NULL);
|
encoded_user_id = soup_uri_encode(user_id, NULL);
|
||||||
path = g_strdup_printf("presence/%s/status", encoded_user_id);
|
path = g_strdup_printf("presence/%s/status", encoded_user_id);
|
||||||
@ -1742,7 +1741,6 @@ i_invite_user_3rdparty(MatrixAPI *api,
|
|||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
gchar *encoded_room_id, *path;
|
gchar *encoded_room_id, *path;
|
||||||
JsonBuilder *builder;
|
|
||||||
JsonNode *body;
|
JsonNode *body;
|
||||||
|
|
||||||
encoded_room_id = soup_uri_encode(room_id, NULL);
|
encoded_room_id = soup_uri_encode(room_id, NULL);
|
||||||
|
@ -45,14 +45,6 @@ typedef struct _MatrixHTTPClientPrivate {
|
|||||||
guint event_timeout;
|
guint event_timeout;
|
||||||
} MatrixHTTPClientPrivate;
|
} MatrixHTTPClientPrivate;
|
||||||
|
|
||||||
enum {
|
|
||||||
PROP_BASE_URL = 1,
|
|
||||||
PROP_VALIDATE_CERTIFICATE,
|
|
||||||
N_PROPERTIES
|
|
||||||
};
|
|
||||||
|
|
||||||
static GParamSpec *obj_properties[N_PROPERTIES] = {NULL,};
|
|
||||||
|
|
||||||
static void matrix_http_client_matrix_client_init(MatrixClientInterface *iface);
|
static void matrix_http_client_matrix_client_init(MatrixClientInterface *iface);
|
||||||
static void i_begin_polling(MatrixClient *client, GError **error);
|
static void i_begin_polling(MatrixClient *client, GError **error);
|
||||||
|
|
||||||
|
@ -400,8 +400,8 @@ matrix_filter_rules_delete_sender(MatrixFilterRules *rules, const gchar *sender)
|
|||||||
|
|
||||||
g_return_if_fail(sender != NULL);
|
g_return_if_fail(sender != NULL);
|
||||||
|
|
||||||
while (sender_element = g_list_find_custom(rules->senders, sender,
|
while ((sender_element = g_list_find_custom(rules->senders, sender,
|
||||||
(GCompareFunc)g_strcmp0)) {
|
(GCompareFunc)g_strcmp0))) {
|
||||||
rules->senders = g_list_remove_link(rules->senders, sender_element);
|
rules->senders = g_list_remove_link(rules->senders, sender_element);
|
||||||
g_list_free_full(sender_element, g_free);
|
g_list_free_full(sender_element, g_free);
|
||||||
}
|
}
|
||||||
@ -490,8 +490,8 @@ matrix_filter_rules_delete_excluded_sender(MatrixFilterRules *rules,
|
|||||||
|
|
||||||
g_return_if_fail(sender != NULL);
|
g_return_if_fail(sender != NULL);
|
||||||
|
|
||||||
while (sender_element = g_list_find_custom(rules->excluded_senders, sender,
|
while ((sender_element = g_list_find_custom(rules->excluded_senders, sender,
|
||||||
(GCompareFunc)g_strcmp0)) {
|
(GCompareFunc)g_strcmp0))) {
|
||||||
rules->excluded_senders = g_list_remove_link(rules->excluded_senders,
|
rules->excluded_senders = g_list_remove_link(rules->excluded_senders,
|
||||||
sender_element);
|
sender_element);
|
||||||
g_list_free_full(sender_element, g_free);
|
g_list_free_full(sender_element, g_free);
|
||||||
@ -571,8 +571,8 @@ matrix_filter_rules_delete_room(MatrixFilterRules *rules, const gchar *room)
|
|||||||
|
|
||||||
g_return_if_fail(room != NULL);
|
g_return_if_fail(room != NULL);
|
||||||
|
|
||||||
while (room_element = g_list_find_custom(rules->rooms, room,
|
while ((room_element = g_list_find_custom(rules->rooms, room,
|
||||||
(GCompareFunc)g_strcmp0)) {
|
(GCompareFunc)g_strcmp0))) {
|
||||||
rules->rooms = g_list_remove_link(rules->rooms, room_element);
|
rules->rooms = g_list_remove_link(rules->rooms, room_element);
|
||||||
g_list_free_full(room_element, g_free);
|
g_list_free_full(room_element, g_free);
|
||||||
}
|
}
|
||||||
@ -657,8 +657,8 @@ matrix_filter_rules_delete_excluded_room(MatrixFilterRules *rules,
|
|||||||
|
|
||||||
g_return_if_fail(room != NULL);
|
g_return_if_fail(room != NULL);
|
||||||
|
|
||||||
while (room_element = g_list_find_custom(rules->excluded_rooms, room,
|
while ((room_element = g_list_find_custom(rules->excluded_rooms, room,
|
||||||
(GCompareFunc)g_strcmp0)) {
|
(GCompareFunc)g_strcmp0))) {
|
||||||
rules->excluded_rooms = g_list_remove_link(rules->excluded_rooms,
|
rules->excluded_rooms = g_list_remove_link(rules->excluded_rooms,
|
||||||
room_element);
|
room_element);
|
||||||
g_list_free_full(room_element, g_free);
|
g_list_free_full(room_element, g_free);
|
||||||
@ -738,8 +738,8 @@ matrix_filter_rules_delete_type(MatrixFilterRules *rules,
|
|||||||
|
|
||||||
g_return_if_fail(event_type != NULL);
|
g_return_if_fail(event_type != NULL);
|
||||||
|
|
||||||
while (type_element = g_list_find_custom(rules->types, event_type,
|
while ((type_element = g_list_find_custom(rules->types, event_type,
|
||||||
(GCompareFunc)g_strcmp0)) {
|
(GCompareFunc)g_strcmp0))) {
|
||||||
rules->types = g_list_remove_link(rules->types, type_element);
|
rules->types = g_list_remove_link(rules->types, type_element);
|
||||||
g_list_free_full(type_element, g_free);
|
g_list_free_full(type_element, g_free);
|
||||||
}
|
}
|
||||||
@ -823,8 +823,8 @@ matrix_filter_rules_delete_excluded_type(MatrixFilterRules *rules,
|
|||||||
|
|
||||||
g_return_if_fail(event_type != NULL);
|
g_return_if_fail(event_type != NULL);
|
||||||
|
|
||||||
while (type_element = g_list_find_custom(rules->excluded_types, event_type,
|
while ((type_element = g_list_find_custom(rules->excluded_types, event_type,
|
||||||
(GCompareFunc)g_strcmp0)) {
|
(GCompareFunc)g_strcmp0))) {
|
||||||
rules->excluded_types = g_list_remove_link(rules->excluded_types,
|
rules->excluded_types = g_list_remove_link(rules->excluded_types,
|
||||||
type_element);
|
type_element);
|
||||||
g_list_free_full(type_element, g_free);
|
g_list_free_full(type_element, g_free);
|
||||||
@ -1389,9 +1389,9 @@ matrix_filter_delete_event_field(MatrixFilter *filter, const gchar *event_field)
|
|||||||
|
|
||||||
g_return_if_fail(event_field != NULL);
|
g_return_if_fail(event_field != NULL);
|
||||||
|
|
||||||
while (event_field_element = g_list_find_custom(filter->event_fields,
|
while ((event_field_element = g_list_find_custom(filter->event_fields,
|
||||||
event_field,
|
event_field,
|
||||||
(GCompareFunc)g_strcmp0)) {
|
(GCompareFunc)g_strcmp0))) {
|
||||||
filter->event_fields = g_list_remove_link(filter->event_fields,
|
filter->event_fields = g_list_remove_link(filter->event_fields,
|
||||||
event_field_element);
|
event_field_element);
|
||||||
g_list_free_full(event_field_element, g_free);
|
g_list_free_full(event_field_element, g_free);
|
||||||
|
@ -155,7 +155,6 @@ int
|
|||||||
main(int argc, char *argv[])
|
main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
MatrixAPI *api;
|
MatrixAPI *api;
|
||||||
GHashTable *params;
|
|
||||||
GMainLoop *loop = g_main_loop_new(NULL, FALSE);
|
GMainLoop *loop = g_main_loop_new(NULL, FALSE);
|
||||||
GOptionContext *opts;
|
GOptionContext *opts;
|
||||||
GError *err = NULL;
|
GError *err = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user