commit - 90eac7479efe209eac4df46846fb74851d671ef8
commit + b17e9748fad9efd9f4e51b908831b1d6e02876b4
blob - 1b65d4428400d8ada970ac351eadd402bd5f2f60
blob + cd1ea06680981ad7958e3e4aca5e9b28a21bc83e
--- arraylist.h
+++ arraylist.h
* // enlarges the allocated array as needed;
* // list.head may change due to realloc
* ARRAYLIST_ADD(x, list);
- * if (!x)
+ * if (x == NULL)
* abort();
* *x = random_foo_value;
* }
blob - 6b81da5097f413165d395437388a92004d74bb2a
blob + 5df77cf87ea5fd7b1b3e3d0073f2fa02e5c76edc
--- debug.h
+++ debug.h
{
const char *s;
- if (!atom) {
+ if (atom == NULL) {
print("NULL atom\n");
return;
}
blob - a99ba63a9c677f5ece15973291d9a5c5ae3e84dc
blob + 25e677acde4b2f4134a80545ab78564c5dbb42c0
--- diff_atomize_text.c
+++ diff_atomize_text.c
/* Record the found line as diff atom */
ARRAYLIST_ADD(atom, d->atoms);
- if (!atom)
+ if (atom == NULL)
return DIFF_RC_ENOMEM;
*atom = (struct diff_atom){
blob - 56a2983c1ad2e85915e26f7216896658700a0d40
blob + c2ff26743452e2940ddd5e6fc83094b3f5d169de
--- diff_main.c
+++ diff_main.c
result = &state->temp_result;
ARRAYLIST_ADD(chunk, *result);
- if (!chunk)
+ if (chunk == NULL)
return NULL;
*chunk = (struct diff_chunk) {
.solved = solved,
void
diff_data_free(struct diff_data *diff_data)
{
- if (!diff_data)
+ if (diff_data == NULL)
return;
if (diff_data->atoms.allocated)
ARRAYLIST_FREE(diff_data->atoms);
ARRAYLIST_FREE(state->temp_result);
- if (!algo_config || !algo_config->impl || !state->recursion_depth_left){
+ if (algo_config == NULL || !algo_config->impl ||
+ !state->recursion_depth_left) {
debug("MAX RECURSION REACHED, just dumping diff chunks\n");
return diff_algo_none(algo_config, state);
}
struct diff_chunk *final_c;
ARRAYLIST_ADD(final_c, state->result->chunks);
- if (!final_c) {
+ if (final_c == NULL) {
rc = DIFF_RC_ENOMEM;
goto return_rc;
}
struct diff_state state;
result = malloc(sizeof(struct diff_result));
- if (!result)
+ if (result == NULL)
return NULL;
*result = (struct diff_result){};
diff_data_init_root(&result->left, left_data, left_len);
diff_data_init_root(&result->right, right_data, right_len);
- if (!config->atomize_func) {
+ if (config->atomize_func == NULL) {
result->rc = DIFF_RC_EINVAL;
return result;
}
void
diff_result_free(struct diff_result *result)
{
- if (!result)
+ if (result == NULL)
return;
diff_data_free(&result->left);
diff_data_free(&result->right);
blob - 2af135b66a21409f60158b61d17612fdbaf53cb7
blob + cfec82d7353470014c6249bc2c73c7273c40181f
--- diff_main.h
+++ diff_main.h
static inline int
range_len(const struct range *r)
{
- if (!r)
+ if (r == NULL)
return 0;
return r->end - r->start;
}
blob - 3ac0aea1fea278e8b4ac34648f22ee49af9a008c
blob + 43229a63cba7d76528b622c7c2cdab6a6a86ed7c
--- diff_myers.c
+++ diff_myers.c
size_t kd_len = max + 1;
size_t kd_buf_size = kd_len << 1;
int *kd_buf = reallocarray(NULL, kd_buf_size, sizeof(int));
- if (!kd_buf)
+ if (kd_buf == NULL)
return DIFF_RC_ENOMEM;
int i;
for (i = 0; i < kd_buf_size; i++)
}
int *kd_buf = reallocarray(NULL, kd_buf_size, sizeof(int));
- if (!kd_buf)
+ if (kd_buf == NULL)
return DIFF_RC_ENOMEM;
int i;
for (i = 0; i < kd_buf_size; i++)
blob - 5f5769aa7ddcab3c2cb38ad4156cc8e208647fd4
blob + cf447d798c044ec7058121d36ed597b8066a575b
--- diff_output.c
+++ diff_output.c
return DIFF_RC_EINVAL;
result = diff_main(diff_config, info->left_buffer, left_len,
info->right_buffer, right_len);
- if (!result)
+ if (result == NULL)
return DIFF_RC_EINVAL;
if (result->rc != DIFF_RC_OK)
return result->rc;
return DIFF_RC_EINVAL;
result = diff_main(diff_config, info->left_buffer, left_len,
info->right_buffer, right_len);
- if (!result)
+ if (result == NULL)
return DIFF_RC_EINVAL;
if (result->rc != DIFF_RC_OK)
return result->rc;