mirror of
https://github.com/Z3Prover/z3
synced 2026-07-17 04:25:44 +00:00
This is another PR towards the goal of getting Z3 to compile cleanly when included via FetchContents into clang-tidy, which uses a pretty strict set of warnings. This is a second version of https://github.com/Z3Prover/z3/pull/9957. I address @NikolajBjorner 's comments about not changing the semicolons after macro invocations, because some editors work better with them present. It now, to the best of my ability, only deletes semis: * after the closing brace of namespace decl. * after the closing brace of an extern "C" decl. * after a function definition. This PR is very large, but it consists entirely of deletions of semicolons in these situations. (If there was a way to update the previous PR, which had been closed, and that is preferable, please let me know. I couldn't figure it out.)
24 lines
597 B
C
24 lines
597 B
C
/*++
|
|
Copyright (c) 2006 Microsoft Corporation
|
|
|
|
Module Name:
|
|
|
|
sign.h
|
|
|
|
Abstract:
|
|
|
|
Sign
|
|
|
|
Author:
|
|
|
|
Nikolaj Bjorner
|
|
|
|
--*/
|
|
|
|
#pragma once
|
|
|
|
typedef enum { sign_neg = -1, sign_zero = 0, sign_pos = 1} sign;
|
|
static inline sign operator-(sign s) { switch (s) { case sign_neg: return sign_pos; case sign_pos: return sign_neg; default: return sign_zero; } }
|
|
static inline sign to_sign(int s) { return s == 0 ? sign_zero : (s > 0 ? sign_pos : sign_neg); }
|
|
static inline sign operator*(sign a, sign b) { return to_sign((int)a * (int)b); }
|
|
static inline bool is_zero(sign s) { return s == sign_zero; }
|