diff options
| author | Tyge Løvset <[email protected]> | 2020-08-02 10:35:34 +0200 |
|---|---|---|
| committer | Tyge Løvset <[email protected]> | 2020-08-02 10:35:34 +0200 |
| commit | 13393d3cbc81e5c5d3ea8335694280ef16a5a84f (patch) | |
| tree | 6ee0ff301dcfed2c4ddbb7f5729c10db68058fa2 /examples | |
| parent | 61bf766fd557db5f94ae86fbe390d64ef8644ee1 (diff) | |
| download | STC-modified-13393d3cbc81e5c5d3ea8335694280ef16a5a84f.tar.gz STC-modified-13393d3cbc81e5c5d3ea8335694280ef16a5a84f.zip | |
Add c_nullptr to cdefs.h
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/benchmark.c | 2 | ||||
| -rw-r--r-- | examples/geek5.c | 4 | ||||
| -rw-r--r-- | examples/geek6.c | 2 | ||||
| -rw-r--r-- | examples/geek7.c | 2 |
4 files changed, 5 insertions, 5 deletions
diff --git a/examples/benchmark.c b/examples/benchmark.c index 7b707260..ae41dec6 100644 --- a/examples/benchmark.c +++ b/examples/benchmark.c @@ -35,7 +35,7 @@ crandom_eng64_t rng; ; cmap_##tag##_set_load_factors(&map, max_load_factor, 0.0)
#define CMAP_PUT(tag, key, val) cmap_##tag##_put(&map, key, val)->value
#define CMAP_ERASE(tag, key) cmap_##tag##_erase(&map, key)
-#define CMAP_FIND(tag, key) (cmap_##tag##_find(map, key) != NULL)
+#define CMAP_FIND(tag, key) (cmap_##tag##_find(map, key) != c_nullptr)
#define CMAP_SIZE(tag) cmap_size(map)
#define CMAP_BUCKETS(tag) (map).bucket_count
#define CMAP_CLEAR(tag) cmap_##tag##_destroy(&map)
diff --git a/examples/geek5.c b/examples/geek5.c index 67f5d097..cbfc40e6 100644 --- a/examples/geek5.c +++ b/examples/geek5.c @@ -37,7 +37,7 @@ int NumOccurrences(const char* arr[], int n, const char* str, int L, int R) // If current string doesn't
// have an entry in the map
// then create the entry
- if (it == NULL) {
+ if (it == c_nullptr) {
cvec_i A = cvec_init;
cvec_i_push_back(&A, i + 1);
cmap_sv_put(&M, temp, A);
@@ -51,7 +51,7 @@ int NumOccurrences(const char* arr[], int n, const char* str, int L, int R) // If the given string is not
// present in the array
- if (it == NULL)
+ if (it == c_nullptr)
return 0;
// If the given string is present
diff --git a/examples/geek6.c b/examples/geek6.c index db0b3bcf..b3991e99 100644 --- a/examples/geek6.c +++ b/examples/geek6.c @@ -52,7 +52,7 @@ int missingNumber(int a[], int n) // Return the first value starting
// from 1 which does not exists in map
while (1) {
- if (cset_i_find(&mp, index) == NULL) {
+ if (cset_i_find(&mp, index) == c_nullptr) {
return index;
}
diff --git a/examples/geek7.c b/examples/geek7.c index 9a60c0a9..0976bf80 100644 --- a/examples/geek7.c +++ b/examples/geek7.c @@ -49,7 +49,7 @@ void findElementsAfterDel(int arr[], int m, int del[], // Search if the element is present
cmap_ii_entry_t *e = cmap_ii_find(&mp, arr[i]);
- if (e != NULL) {
+ if (e != c_nullptr) {
// Decrement its frequency
e->value--;
|
