trivial: Fix up some NULL/FALSE confusion

This commit is contained in:
Richard Hughes 2018-05-29 09:33:44 +01:00
parent caf379dc00
commit fe221dc13d
7 changed files with 12 additions and 12 deletions

View File

@ -448,7 +448,7 @@ fwupd_build_history_report_json (GPtrArray *devices, GError **error)
/* get a hash that represents the machine */
machine_id = fwupd_build_machine_id ("fwupd", error);
if (machine_id == NULL)
return FALSE;
return NULL;
/* create header */
builder = json_builder_new ();
@ -462,7 +462,7 @@ fwupd_build_history_report_json (GPtrArray *devices, GError **error)
json_builder_set_member_name (builder, "Metadata");
json_builder_begin_object (builder);
if (!fwupd_build_history_report_json_metadata (builder, error))
return FALSE;
return NULL;
json_builder_end_object (builder);
/* add each device */

View File

@ -286,7 +286,7 @@ fu_csr_device_upload (FuDevice *device, GError **error)
/* hit hardware */
chunk = fu_csr_device_upload_chunk (self, error);
if (chunk == NULL)
return FALSE;
return NULL;
chunk_sz = g_bytes_get_size (chunk);
/* get the total size using the CSR header */

View File

@ -344,5 +344,5 @@ dfu_firmware_to_srec (DfuFirmware *firmware, GError **error)
FWUPD_ERROR,
FWUPD_ERROR_NOT_SUPPORTED,
"Motorola S-record export functionality missing");
return FALSE;
return NULL;
}

View File

@ -1427,7 +1427,7 @@ dfu_tool_get_device_string (DfuToolPrivate *priv, DfuDevice *device)
error->message);
}
if (!dfu_device_refresh (device, &error))
return FALSE;
return NULL;
}
return g_strdup_printf ("%04x:%04x [%s:%s]",
dfu_device_get_vid (device),

View File

@ -380,7 +380,7 @@ fu_common_store_from_cab_bytes (GBytes *blob, guint64 size_max, GError **error)
FWUPD_ERROR,
FWUPD_ERROR_INVALID_FILE,
"archive contained no valid metadata");
return FALSE;
return NULL;
}
return g_steal_pointer (&store);
}

View File

@ -2547,7 +2547,7 @@ fu_engine_get_results (FuEngine *self, const gchar *device_id, GError **error)
/* find the device */
device = fu_engine_get_item_by_id_fallback_history (self, device_id, error);
if (device == NULL)
return FALSE;
return NULL;
/* the notification has already been shown to the user */
if (fu_device_has_flag (device, FWUPD_DEVICE_FLAG_NOTIFIED)) {

View File

@ -549,7 +549,7 @@ fu_history_get_device_by_id (FuHistory *self, const gchar *device_id, GError **e
g_autoptr(sqlite3_stmt) stmt = NULL;
g_return_val_if_fail (FU_IS_HISTORY (self), NULL);
g_return_val_if_fail (device_id != NULL, FALSE);
g_return_val_if_fail (device_id != NULL, NULL);
/* lazy load */
if (!fu_history_load (self, error))
@ -577,12 +577,12 @@ fu_history_get_device_by_id (FuHistory *self, const gchar *device_id, GError **e
g_set_error (error, FWUPD_ERROR, FWUPD_ERROR_INTERNAL,
"Failed to prepare SQL: %s",
sqlite3_errmsg (self->db));
return FALSE;
return NULL;
}
sqlite3_bind_text (stmt, 1, device_id, -1, SQLITE_STATIC);
array_tmp = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
if (!fu_history_stmt_exec (self, stmt, array_tmp, error))
return FALSE;
return NULL;
if (array_tmp->len == 0) {
g_set_error_literal (error,
FWUPD_ERROR,
@ -632,11 +632,11 @@ fu_history_get_devices (FuHistory *self, GError **error)
g_set_error (error, FWUPD_ERROR, FWUPD_ERROR_INTERNAL,
"Failed to prepare SQL: %s",
sqlite3_errmsg (self->db));
return FALSE;
return NULL;
}
array_tmp = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
if (!fu_history_stmt_exec (self, stmt, array_tmp, error))
return FALSE;
return NULL;
array = g_ptr_array_ref (array_tmp);
return array;
}