Skip to content

Commit

Permalink
fmt: align the custom values of the enum fields (#19331)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyi98 committed Sep 12, 2023
1 parent c98e00c commit 55ca8d8
Show file tree
Hide file tree
Showing 47 changed files with 1,342 additions and 1,322 deletions.
6 changes: 3 additions & 3 deletions examples/viewer/file_scan.v
Expand Up @@ -27,13 +27,13 @@ import os
*
******************************************************************************/
enum Item_type {
file = 0
file = 0
folder
// archive format
zip = 16
zip = 16
archive_file
// graphic format, MUST stay after the other types!!
bmp = 32
bmp = 32
jpg
png
gif
Expand Down
174 changes: 87 additions & 87 deletions vlib/builtin/linux_bare/linux_syscalls.v
@@ -1,105 +1,105 @@
module builtin

enum SigIndex {
si_signo = 0x00
si_code = 0x02
si_pid = 0x04
si_uid = 0x05
si_signo = 0x00
si_code = 0x02
si_pid = 0x04
si_uid = 0x05
si_status = 0x06
si_size = 0x80
si_size = 0x80
}

enum Signo {
sighup = 1 // Hangup.
sigint = 2 // Interactive attention signal.
sigquit = 3 // Quit.
sigill = 4 // Illegal instruction.
sigtrap = 5 // Trace/breakpoint trap.
sigabrt = 6 // Abnormal termination.
sigbus = 7
sigfpe = 8 // Erroneous arithmetic operation.
sigkill = 9 // Killed.
sigusr1 = 10
sigsegv = 11 // Invalid access to memory.
sigusr2 = 12
sigpipe = 13 // Broken pipe.
sigalrm = 14 // Alarm clock.
sigterm = 15 // Termination request.
sighup = 1 // Hangup.
sigint = 2 // Interactive attention signal.
sigquit = 3 // Quit.
sigill = 4 // Illegal instruction.
sigtrap = 5 // Trace/breakpoint trap.
sigabrt = 6 // Abnormal termination.
sigbus = 7
sigfpe = 8 // Erroneous arithmetic operation.
sigkill = 9 // Killed.
sigusr1 = 10
sigsegv = 11 // Invalid access to memory.
sigusr2 = 12
sigpipe = 13 // Broken pipe.
sigalrm = 14 // Alarm clock.
sigterm = 15 // Termination request.
sigstkflt = 16
sigchld = 17
sigcont = 18
sigstop = 19
sigtstp = 20
sigttin = 21 // Background read from control terminal.
sigttou = 22 // Background write to control terminal.
sigurg = 23
sigxcpu = 24 // CPU time limit exceeded.
sigxfsz = 25 // File size limit exceeded.
sigchld = 17
sigcont = 18
sigstop = 19
sigtstp = 20
sigttin = 21 // Background read from control terminal.
sigttou = 22 // Background write to control terminal.
sigurg = 23
sigxcpu = 24 // CPU time limit exceeded.
sigxfsz = 25 // File size limit exceeded.
sigvtalrm = 26 // Virtual timer expired.
sigprof = 27 // Profiling timer expired.
sigwinch = 28
sigpoll = 29
sigsys = 31
sigprof = 27 // Profiling timer expired.
sigwinch = 28
sigpoll = 29
sigsys = 31
}

// List of all the errors returned by syscalls
enum Errno {
enoerror = 0x00000000
eperm = 0x00000001
enoent = 0x00000002
esrch = 0x00000003
eintr = 0x00000004
eio = 0x00000005
enxio = 0x00000006
e2big = 0x00000007
enoexec = 0x00000008
ebadf = 0x00000009
echild = 0x0000000a
eagain = 0x0000000b
enomem = 0x0000000c
eacces = 0x0000000d
efault = 0x0000000e
enotblk = 0x0000000f
ebusy = 0x00000010
eexist = 0x00000011
exdev = 0x00000012
enodev = 0x00000013
enotdir = 0x00000014
eisdir = 0x00000015
einval = 0x00000016
enfile = 0x00000017
emfile = 0x00000018
enotty = 0x00000019
etxtbsy = 0x0000001a
efbig = 0x0000001b
enospc = 0x0000001c
espipe = 0x0000001d
erofs = 0x0000001e
emlink = 0x0000001f
epipe = 0x00000020
edom = 0x00000021
erange = 0x00000022
eperm = 0x00000001
enoent = 0x00000002
esrch = 0x00000003
eintr = 0x00000004
eio = 0x00000005
enxio = 0x00000006
e2big = 0x00000007
enoexec = 0x00000008
ebadf = 0x00000009
echild = 0x0000000a
eagain = 0x0000000b
enomem = 0x0000000c
eacces = 0x0000000d
efault = 0x0000000e
enotblk = 0x0000000f
ebusy = 0x00000010
eexist = 0x00000011
exdev = 0x00000012
enodev = 0x00000013
enotdir = 0x00000014
eisdir = 0x00000015
einval = 0x00000016
enfile = 0x00000017
emfile = 0x00000018
enotty = 0x00000019
etxtbsy = 0x0000001a
efbig = 0x0000001b
enospc = 0x0000001c
espipe = 0x0000001d
erofs = 0x0000001e
emlink = 0x0000001f
epipe = 0x00000020
edom = 0x00000021
erange = 0x00000022
}

enum MemProt {
prot_read = 0x1
prot_write = 0x2
prot_exec = 0x4
prot_none = 0x0
prot_read = 0x1
prot_write = 0x2
prot_exec = 0x4
prot_none = 0x0
prot_growsdown = 0x01000000
prot_growsup = 0x02000000
prot_growsup = 0x02000000
}

enum MapFlags {
map_shared = 0x01
map_private = 0x02
map_shared = 0x01
map_private = 0x02
map_shared_validate = 0x03
map_type = 0x0f
map_fixed = 0x10
map_file = 0x00
map_anonymous = 0x20
map_huge_shift = 26
map_huge_mask = 0x3f
map_type = 0x0f
map_fixed = 0x10
map_file = 0x00
map_anonymous = 0x20
map_huge_shift = 26
map_huge_mask = 0x3f
}

// const (
Expand Down Expand Up @@ -208,17 +208,17 @@ const (

// First argument to waitid:
enum WiWhich {
p_all = 0
p_pid = 1
p_all = 0
p_pid = 1
p_pgid = 2
}

enum WiSiCode {
cld_exited = 1 // child has exited
cld_killed = 2 // child was killed
cld_dumped = 3 // child terminated abnormally
cld_trapped = 4 // traced child has trapped
cld_stopped = 5 // child has stopped
cld_exited = 1 // child has exited
cld_killed = 2 // child was killed
cld_dumped = 3 // child terminated abnormally
cld_trapped = 4 // traced child has trapped
cld_stopped = 5 // child has stopped
cld_continued = 6 // stopped child has continued
}

Expand Down

0 comments on commit 55ca8d8

Please sign in to comment.