Skip to content

Commit

Permalink
docs: update C/C++ code block syntax in README for Doxygen
Browse files Browse the repository at this point in the history
This syntax is processed correctly by Doxygen

Signed-off-by: Adarsh <[email protected]>
  • Loading branch information
AdarshRawat1 committed Oct 29, 2024
1 parent 9edb285 commit 2a01e6c
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion backends/ebpf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ clang -O2 -include C-EXTERN-FILE.c -target bpf -c OUTPUT.c -o OUTPUT.o

* BPF maps can be defined inside the C extern function to provide statefulness. BPF map can be defined as follows:

```C
```c
REGISTER_START()
REGISTER_TABLE(<NAME>, BPF_MAP_TYPE_HASH, <KEY-SIZE>, <VALUE-SIZE>>, <MAX_ENTRIES>)
REGISTER_END()
Expand Down
2 changes: 1 addition & 1 deletion backends/ebpf/psa/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ if (as_group_state == 0) {
<!--!
\internal
-->
``` c
```c
struct ingress_as_value * as_value = NULL; // pointer to an action data
u32 as_action_ref = value->ingress_as_ref; // value->ingress_as_ref is entry from table (reference)
u8 as_group_state = 0; // which map contains action data
Expand Down
4 changes: 2 additions & 2 deletions backends/tofino/bf-p4c/phv/slicing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ split. The algorithm is as follows:
3. Restore the state by removing *head* from result and *tail* from header.

Pseudo codes of the DFS:
```c++
```cpp
// global states
Headers = [A, B, C, D];
Result = []
Expand Down Expand Up @@ -397,7 +397,7 @@ enhancing our after-split constraint. Previously, an after-split constraint can
the 'exact' requirement. We introduce a less restricted form of after-split constraint, which
specifies a minimum size of the list that a metadata resides in.

```c++
```cpp
struct AfterSplitConstraint {
enum class ConstraintType {
EXACT = 0, // must be placed in container of the size.
Expand Down
2 changes: 1 addition & 1 deletion backends/tofino/bf-p4c/phv/solver/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ check and generate instruction based on the PHV allocation.
## Example of using Z3
an example of using z3 to validate deposit field. Unfortunately it's about 20ms per invocation,
which is too slow for us.
``` c++
```cpp
boost::optional<Error> ActionMoveSolver::run_deposit_field_z3_solver(
const ContainerID dest, const std::vector<Assign>& src1,
const std::vector<Assign>& src2) const {
Expand Down
2 changes: 1 addition & 1 deletion docs/CodingStandardPhilosophy.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ the `boost::format` for the format argument, which has some
compatibility for `printf` arguments. These functions handle IR and
SourceInfo objects smartly. Here is an example:

``` C++
```cpp
IR::NamedRef *ref;
error(ErrorType::ERR_INVALID,
"%1%: No header or metadata named '%2%'", ref->srcInfo, ref->name);
Expand Down
4 changes: 2 additions & 2 deletions docs/IR.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ IR tree and accumulates information about the tree but does not modify
it, while a Transform pass visits every node, possibly modifying the
node or replacing it with some other node

``` C++
```cpp
/* pseudo-code for basic Transform visitor */
visit(node, context=ROOT, visited={}) {
if (node in visited) {
Expand Down Expand Up @@ -152,7 +152,7 @@ As an example for how these are used in the IR visitor routines, the IR::If clas
three children to visit -- a predicate and two consequents, with the value of the
predicate deciding which consequent to execute. The child visitor for `IR::If` is
``` C++
```cpp
visitor.visit(predicate);
clone = visitor.flow_clone();
visitor.visit(ifTrue);
Expand Down

0 comments on commit 2a01e6c

Please sign in to comment.