Skip to content

Commit 27872bd

Browse files
apply changes to operator names
1 parent 1db5d15 commit 27872bd

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

code/logic/fossil/pizza/common.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -197,25 +197,25 @@ extern "C" {
197197
*
198198
* Mimics Rust's memory safety using explicit pointer management.
199199
*/
200-
#define drop(ptr) do { nullify(ptr); } while (0)
200+
#define pizza_drop(ptr) do { nullify(ptr); } while (0)
201201

202202
/**
203203
* @brief Panic behavior for immediate program termination with error message.
204204
*
205205
* This macro causes the program to immediately terminate with an error message,
206-
* similar to Rust's `panic!()` functionality.
206+
* similar to Rust's `pizza_panic!()` functionality.
207207
*
208-
* @param msg The message to display when panicking.
208+
* @param msg The message to display when pizza_panicking.
209209
*/
210-
#define panic(msg) (pizza_io_fprintf(PIZZA_STDERR, "Panic: %s\n", msg), exit(EXIT_FAILURE))
210+
#define pizza_panic(msg) (pizza_io_fprintf(PIZZA_STDERR, "Panic: %s\n", msg), exit(EXIT_FAILURE))
211211

212212
/**
213213
* @brief Mimics Rust's Option type.
214214
*
215-
* The `coptional` macro represents a nullable pointer that can be either `null` or a valid pointer.
215+
* The `pizza_optional` macro represents a nullable pointer that can be either `null` or a valid pointer.
216216
* It can be used to model optional values that may or may not be present.
217217
*/
218-
#define coptional(ptr) ((ptr) ? (ptr) : null)
218+
#define pizza_optional(ptr) ((ptr) ? (ptr) : null)
219219

220220
/**
221221
* @brief `Option` structure to mimic Rust's `Option<T>`.
@@ -235,9 +235,9 @@ typedef struct {
235235
* @return The created `Option` containing the value.
236236
*/
237237
#ifdef __cplusplus
238-
#define some(val) (Option{val, 1})
238+
#define pizza_some(val) (Option{val, 1})
239239
#else
240-
#define some(val) ((Option){(void*)(val), 1})
240+
#define pizza_some(val) ((Option){(void*)(val), 1})
241241
#endif
242242

243243
/**
@@ -246,13 +246,13 @@ typedef struct {
246246
* @return An `Option` representing `None`.
247247
*/
248248
#ifdef __cplusplus
249-
#define none() (Option{null, 0})
249+
#define pizza_none() (Option{null, 0})
250250
#else
251-
#define none() ((Option){null, 0})
251+
#define pizza_none() ((Option){null, 0})
252252
#endif
253253

254254
/**
255-
* @brief Unwraps the `Option`. If it's `Some`, return the value; if it's `None`, panic.
255+
* @brief Unwraps the `Option`. If it's `Some`, return the value; if it's `None`, pizza_panic.
256256
*
257257
* Mimics Rust's `Option::unwrap()`.
258258
*

0 commit comments

Comments
 (0)