/* SPDX-License-Identifier: LGPL-2.1-or-later */
-@@
/* We want to stick with dup() in test-fd-util.c */
-position p : script:python() { p[0].file != "src/test/test-fd-util.c" };
+@ depends on !(file in "src/test/test-fd-util.c") @
expression fd;
@@
-- dup@p(fd)
+- dup(fd)
+ fcntl(fd, F_DUPFD, 3)
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-@@
/* Disable this transformation for the test-string-util.c */
-position p : script:python() { p[0].file != "src/test/test-string-util.c" };
+@ depends on !(file in "src/test/test-string-util.c") @
expression s;
@@
(
-- strv_length@p(s) == 0
+- strv_length(s) == 0
+ strv_isempty(s)
|
-- strv_length@p(s) <= 0
+- strv_length(s) <= 0
+ strv_isempty(s)
|
-- strv_length@p(s) > 0
+- strv_length(s) > 0
+ !strv_isempty(s)
|
-- strv_length@p(s) != 0
+- strv_length(s) != 0
+ !strv_isempty(s)
|
-- strlen@p(s) == 0
+- strlen(s) == 0
+ isempty(s)
|
-- strlen@p(s) <= 0
+- strlen(s) <= 0
+ isempty(s)
|
-- strlen@p(s) > 0
+- strlen(s) > 0
+ !isempty(s)
|
-- strlen@p(s) != 0
+- strlen(s) != 0
+ !isempty(s)
|
-- strlen_ptr@p(s) == 0
+- strlen_ptr(s) == 0
+ isempty(s)
|
-- strlen_ptr@p(s) <= 0
+- strlen_ptr(s) <= 0
+ isempty(s)
|
-- strlen_ptr@p(s) > 0
+- strlen_ptr(s) > 0
+ !isempty(s)
|
-- strlen_ptr@p(s) != 0
+- strlen_ptr(s) != 0
+ !isempty(s)
)
-@@
/* Disable this transformation for the hashmap.h, set.h, test-hashmap.c, test-hashmap-plain.c */
-position p : script:python() {
- p[0].file != "src/basic/hashmap.h" and
- p[0].file != "src/basic/set.h" and
- p[0].file != "src/test/test-hashmap.c" and
- p[0].file != "src/test/test-hashmap-plain.c"
- };
+@ depends on !(file in "src/basic/hashmap.h")
+ && !(file in "src/basic/set.h")
+ && !(file in "src/test/test-hashmap.c")
+ && !(file in "src/test/test-hashmap-plain.c") @
expression s;
@@
(
-- hashmap_size@p(s) == 0
+- hashmap_size(s) == 0
+ hashmap_isempty(s)
|
-- hashmap_size@p(s) <= 0
+- hashmap_size(s) <= 0
+ hashmap_isempty(s)
|
-- hashmap_size@p(s) > 0
+- hashmap_size(s) > 0
+ !hashmap_isempty(s)
|
-- hashmap_size@p(s) != 0
+- hashmap_size(s) != 0
+ !hashmap_isempty(s)
|
-- ordered_hashmap_size@p(s) == 0
+- ordered_hashmap_size(s) == 0
+ ordered_hashmap_isempty(s)
|
-- ordered_hashmap_size@p(s) <= 0
+- ordered_hashmap_size(s) <= 0
+ ordered_hashmap_isempty(s)
|
-- ordered_hashmap_size@p(s) > 0
+- ordered_hashmap_size(s) > 0
+ !ordered_hashmap_isempty(s)
|
-- ordered_hashmap_size@p(s) != 0
+- ordered_hashmap_size(s) != 0
+ !ordered_hashmap_isempty(s)
|
-- set_size@p(s) == 0
+- set_size(s) == 0
+ set_isempty(s)
|
-- set_size@p(s) <= 0
+- set_size(s) <= 0
+ set_isempty(s)
|
-- set_size@p(s) > 0
+- set_size(s) > 0
+ !set_isempty(s)
|
-- set_size@p(s) != 0
+- set_size(s) != 0
+ !set_isempty(s)
|
-- ordered_set_size@p(s) == 0
+- ordered_set_size(s) == 0
+ ordered_set_isempty(s)
|
-- ordered_set_size@p(s) <= 0
+- ordered_set_size(s) <= 0
+ ordered_set_isempty(s)
|
-- ordered_set_size@p(s) > 0
+- ordered_set_size(s) > 0
+ !ordered_set_isempty(s)
|
-- ordered_set_size@p(s) != 0
+- ordered_set_size(s) != 0
+ !ordered_set_isempty(s)
)
@@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-@@
/* Disable this transformation on test-json.c */
-position p : script:python() { p[0].file != "src/test/test-json.c" };
+@ depends on !(file in "src/test/test-json.c") @
expression key, val;
@@
(
-- SD_JSON_BUILD_PAIR@p(key, SD_JSON_BUILD_BOOLEAN(val))
+- SD_JSON_BUILD_PAIR(key, SD_JSON_BUILD_BOOLEAN(val))
+ SD_JSON_BUILD_PAIR_BOOLEAN(key, val)
|
-- SD_JSON_BUILD_PAIR@p(key, SD_JSON_BUILD_INTEGER(val))
+- SD_JSON_BUILD_PAIR(key, SD_JSON_BUILD_INTEGER(val))
+ SD_JSON_BUILD_PAIR_INTEGER(key, val)
|
-- SD_JSON_BUILD_PAIR@p(key, SD_JSON_BUILD_STRING(val))
+- SD_JSON_BUILD_PAIR(key, SD_JSON_BUILD_STRING(val))
+ SD_JSON_BUILD_PAIR_STRING(key, val)
|
-- SD_JSON_BUILD_PAIR@p(key, SD_JSON_BUILD_UNSIGNED(val))
+- SD_JSON_BUILD_PAIR(key, SD_JSON_BUILD_UNSIGNED(val))
+ SD_JSON_BUILD_PAIR_UNSIGNED(key, val)
|
-- SD_JSON_BUILD_PAIR@p(key, SD_JSON_BUILD_VARIANT(val))
+- SD_JSON_BUILD_PAIR(key, SD_JSON_BUILD_VARIANT(val))
+ SD_JSON_BUILD_PAIR_VARIANT(key, val)
)
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-@@
+/* We want to stick with the literal expression in the implementation of timestamp_is_set(), i.e. in time-util.h */
+@ depends on !(file in "src/basic/time-util.h") @
expression x;
constant USEC_INFINITY = USEC_INFINITY;
-/* We want to stick with the literal expression in the implementation of timestamp_is_set(), i.e. in time-util.c */
-position p : script:python() { p[0].file != "src/basic/time-util.h" };
@@
(
- x > 0 && x < USEC_INFINITY
- x < USEC_INFINITY && x > 0
+ timestamp_is_set(x)
|
-- x@p > 0 && x != USEC_INFINITY
+- x > 0 && x != USEC_INFINITY
+ timestamp_is_set(x)
|
- x != USEC_INFINITY && x > 0
/* SPDX-License-Identifier: LGPL-2.1-or-later */
@@
-position p : script:python() { not p[0].file.startswith("man/") };
expression e, fmt;
expression list vaargs;
@@
-- snprintf@p(e, sizeof(e), fmt, vaargs);
+- snprintf(e, sizeof(e), fmt, vaargs);
+ xsprintf(e, fmt, vaargs);
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-@@
-position p : script:python() { p[0].file != "src/journal/lookup3.c" };
-expression e,e1;
+@ depends on !(file in "src/journal/lookup3.c") @
+expression e, e1;
@@
- if (e) {
+ if (e)
(
- e1@p;
+ e1;
|
- return e1@p;
+ return e1;
)
- }