Skip to content

Commit 6273b6d

Browse files
authored
[libc] Change RPC opcode enum definition (#67439)
Summary: This enum previously manually specified the value. This just made it unnecessarily difficult to add new ones without changing everything. This patch also makes it compatible with C by removing the `:` annotation and instead using the `LAST` method.
1 parent c55e5d4 commit 6273b6d

File tree

1 file changed

+20
-19
lines changed

1 file changed

+20
-19
lines changed

libc/include/llvm-libc-types/rpc_opcodes_t.h

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,27 @@
99
#ifndef __LLVM_LIBC_TYPES_RPC_OPCODE_H__
1010
#define __LLVM_LIBC_TYPES_RPC_OPCODE_H__
1111

12-
typedef enum : unsigned short {
12+
typedef enum {
1313
RPC_NOOP = 0,
14-
RPC_EXIT = 1,
15-
RPC_WRITE_TO_STDOUT = 2,
16-
RPC_WRITE_TO_STDERR = 3,
17-
RPC_WRITE_TO_STREAM = 4,
18-
RPC_WRITE_TO_STDOUT_NEWLINE = 5,
19-
RPC_READ_FROM_STREAM = 6,
20-
RPC_OPEN_FILE = 7,
21-
RPC_CLOSE_FILE = 8,
22-
RPC_MALLOC = 9,
23-
RPC_FREE = 10,
24-
RPC_HOST_CALL = 11,
25-
RPC_ABORT = 12,
26-
RPC_FEOF = 13,
27-
RPC_FERROR = 14,
28-
RPC_CLEARERR = 15,
29-
RPC_FSEEK = 16,
30-
RPC_FTELL = 17,
31-
RPC_FFLUSH = 18,
14+
RPC_EXIT,
15+
RPC_WRITE_TO_STDOUT,
16+
RPC_WRITE_TO_STDERR,
17+
RPC_WRITE_TO_STREAM,
18+
RPC_WRITE_TO_STDOUT_NEWLINE,
19+
RPC_READ_FROM_STREAM,
20+
RPC_OPEN_FILE,
21+
RPC_CLOSE_FILE,
22+
RPC_MALLOC,
23+
RPC_FREE,
24+
RPC_HOST_CALL,
25+
RPC_ABORT,
26+
RPC_FEOF,
27+
RPC_FERROR,
28+
RPC_CLEARERR,
29+
RPC_FSEEK,
30+
RPC_FTELL,
31+
RPC_FFLUSH,
32+
RPC_LAST = 0xFFFF,
3233
} rpc_opcode_t;
3334

3435
#endif // __LLVM_LIBC_TYPES_RPC_OPCODE_H__

0 commit comments

Comments
 (0)