Skip to content

Commit 79ee4ae

Browse files
authored
fmt: fix alignment of enumeration types (#21999)
1 parent 3247b98 commit 79ee4ae

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+543
-479
lines changed

cmd/tools/modules/testing/output.v

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import time
44

55
pub enum MessageKind {
66
compile_begin // sent right before *each* _test.v file compilation, the resulting status is not known yet, but the _test.v file itself is
7-
compile_end // sent right after *each* _test.v file compilation, the message contains the output of that compilation
8-
cmd_begin // sent right before *each* _test.v file execution, the resulting status is not known yet, but the _test.v file itself is
9-
cmd_end // sent right after *each* _test.v file execution, the message contains the output of that execution
7+
compile_end // sent right after *each* _test.v file compilation, the message contains the output of that compilation
8+
cmd_begin // sent right before *each* _test.v file execution, the resulting status is not known yet, but the _test.v file itself is
9+
cmd_end // sent right after *each* _test.v file execution, the message contains the output of that execution
1010
//
11-
ok // success of a _test.v file
11+
ok // success of a _test.v file
1212
fail // failed _test.v file, one or more assertions failed
1313
skip // the _test.v file was skipped for some reason
1414
info // a generic information message, detailing the actions of the `v test` program (some tests could be repeated for example, and the details are sent with an .info status)

cmd/tools/vrepl.v

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,14 @@ enum FnType {
7373
}
7474

7575
enum DeclType {
76-
include_ // #include ...
77-
const_ // const ...
78-
type_ // type ...
79-
enum_ // enum ...
80-
fn_ // fn ...
81-
struct_ // struct ...
76+
include_ // #include ...
77+
const_ // const ...
78+
type_ // type ...
79+
enum_ // enum ...
80+
fn_ // fn ...
81+
struct_ // struct ...
8282
interface_ // interface ...
83-
stmt_ // statement
83+
stmt_ // statement
8484
}
8585

8686
fn new_repl(folder string) Repl {

cmd/tools/vtest.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ pub fn (mut ctx Context) should_test_dir(path string, backend string) ([]string,
124124
}
125125

126126
enum ShouldTestStatus {
127-
test // do test, print OK or FAIL, depending on if it passes
128-
skip // print SKIP for the test
127+
test // do test, print OK or FAIL, depending on if it passes
128+
skip // print SKIP for the test
129129
ignore // just ignore the file, so it will not be printed at all in the list of tests
130130
}
131131

doc/docs.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3443,7 +3443,7 @@ Enums can be created from string or integer value and converted into string
34433443
```v
34443444
enum Cycle {
34453445
one
3446-
two = 2
3446+
two = 2
34473447
three
34483448
}
34493449
@@ -5852,7 +5852,7 @@ You can read [Enum](#enums) values and their attributes.
58525852
58535853
```v
58545854
enum Color {
5855-
red @[RED] // first attribute
5855+
red @[RED] // first attribute
58565856
blue @[BLUE] // second attribute
58575857
}
58585858

examples/viewer/file_scan.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ import os
2727
*
2828
******************************************************************************/
2929
enum Item_type {
30-
file = 0
30+
file = 0
3131
folder
3232
// archive format
33-
zip = 16
33+
zip = 16
3434
archive_file
3535
// graphic format, MUST stay after the other types!!
36-
bmp = 32
36+
bmp = 32
3737
jpg
3838
png
3939
gif

vlib/builtin/array.v

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ pub:
2424
pub enum ArrayFlags {
2525
noslices // when <<, `.noslices` will free the old data block immediately (you have to be sure, that there are *no slices* to that specific array). TODO: integrate with reference counting/compiler support for the static cases.
2626
noshrink // when `.noslices` and `.noshrink` are *both set*, .delete(x) will NOT allocate new memory and free the old. It will just move the elements in place, and adjust .len.
27-
nogrow // the array will never be allowed to grow past `.cap`. set `.nogrow` and `.noshrink` for a truly fixed heap array
28-
nofree // `.data` will never be freed
27+
nogrow // the array will never be allowed to grow past `.cap`. set `.nogrow` and `.noshrink` for a truly fixed heap array
28+
nofree // `.data` will never be freed
2929
}
3030

3131
// Internal function, used by V (`nums := []int`)

vlib/builtin/builtin.v

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ pub:
145145
}
146146

147147
pub enum AttributeKind {
148-
plain // [name]
149-
string // ['name']
150-
number // [123]
148+
plain // [name]
149+
string // ['name']
150+
number // [123]
151151
comptime_define // [if name]
152152
}
153153

vlib/compress/zstd/zstd.c.v

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub enum ZSTD_cParameter {
6666
// to default. Setting this will however eventually dynamically impact the compression
6767
// parameters which have not been manually set. The manually set
6868
// ones will 'stick'.
69-
zstd_c_compression_level = 100
69+
zstd_c_compression_level = 100
7070
// Advanced compression parameters :
7171
// It's possible to pin down compression parameters to some specific values.
7272
// In which case, these values are no longer dynamically selected by the compressor
@@ -79,14 +79,14 @@ pub enum ZSTD_cParameter {
7979
// Special: value 0 means "use default windowLog".
8080
// Note: Using a windowLog greater than ZSTD_WINDOWLOG_LIMIT_DEFAULT
8181
// requires explicitly allowing such size at streaming decompression stage.
82-
zstd_c_window_log = 101
82+
zstd_c_window_log = 101
8383
// Size of the initial probe table, as a power of 2.
8484
// Resulting memory usage is (1 << (hashLog+2)).
8585
// Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX.
8686
// Larger tables improve compression ratio of strategies <= dFast,
8787
// and improve speed of strategies > dFast.
8888
// Special: value 0 means "use default hashLog".
89-
zstd_c_hash_log = 102
89+
zstd_c_hash_log = 102
9090
// Size of the multi-probe search table, as a power of 2.
9191
// Resulting memory usage is (1 << (chainLog+2)).
9292
// Must be clamped between ZSTD_CHAINLOG_MIN and ZSTD_CHAINLOG_MAX.
@@ -95,12 +95,12 @@ pub enum ZSTD_cParameter {
9595
// It's still useful when using "dfast" strategy,
9696
// in which case it defines a secondary probe table.
9797
// Special: value 0 means "use default chainLog".
98-
zstd_c_chain_log = 103
98+
zstd_c_chain_log = 103
9999
// Number of search attempts, as a power of 2.
100100
// More attempts result in better and slower compression.
101101
// This parameter is useless for "fast" and "dFast" strategies.
102102
// Special: value 0 means "use default searchLog".
103-
zstd_c_search_log = 104
103+
zstd_c_search_log = 104
104104
// Minimum size of searched matches.
105105
// Note that Zstandard can still find matches of smaller size,
106106
// it just tweaks its search algorithm to look for this size and larger.
@@ -109,7 +109,7 @@ pub enum ZSTD_cParameter {
109109
// Note that currently, for all strategies < btopt, effective minimum is 4.
110110
// , for all strategies > fast, effective maximum is 6.
111111
// Special: value 0 means "use default minMatchLength".
112-
zstd_c_min_match = 105
112+
zstd_c_min_match = 105
113113
// Impact of this field depends on strategy.
114114
// For strategies btopt, btultra & btultra2:
115115
// Length of Match considered "good enough" to stop search.
@@ -118,12 +118,12 @@ pub enum ZSTD_cParameter {
118118
// Distance between match sampling.
119119
// Larger values make compression faster, and weaker.
120120
// Special: value 0 means "use default targetLength".
121-
zstd_c_target_length = 106
121+
zstd_c_target_length = 106
122122
// See ZSTD_strategy enum definition.
123123
// The higher the value of selected strategy, the more complex it is,
124124
// resulting in stronger and slower compression.
125125
// Special: value 0 means "use default strategy".
126-
zstd_c_strategy = 107
126+
zstd_c_strategy = 107
127127
// LDM mode parameters
128128
// Enable long distance matching.
129129
// This parameter is designed to improve compression ratio
@@ -140,34 +140,34 @@ pub enum ZSTD_cParameter {
140140
// Must be clamped between ZSTD_HASHLOG_MIN and ZSTD_HASHLOG_MAX
141141
// default: windowlog - 7.
142142
// Special: value 0 means "automatically determine hashlog".
143-
zstd_c_ldm_hash_log = 161
143+
zstd_c_ldm_hash_log = 161
144144
// Minimum match size for long distance matcher.
145145
// Larger/too small values usually decrease compression ratio.
146146
// Must be clamped between ZSTD_LDM_MINMATCH_MIN and ZSTD_LDM_MINMATCH_MAX.
147147
// Special: value 0 means "use default value" (default: 64).
148-
zstd_c_ldm_min_match = 162
148+
zstd_c_ldm_min_match = 162
149149
// log size of each bucket in the ldm hash table for collision resolution.
150150
// Larger values improve collision resolution but decrease compression speed.
151151
// The maximum value is ZSTD_LDM_BUCKETSIZELOG_MAX.
152152
// Special: value 0 means "use default value" (default: 3).
153-
zstd_c_ldm_bucket_size_log = 163
153+
zstd_c_ldm_bucket_size_log = 163
154154
// Frequency of inserting/looking up entries into the LDM hash table.
155155
// Must be clamped between 0 and (ZSTD_WINDOWLOG_MAX - ZSTD_HASHLOG_MIN).
156156
// Default is MAX(0, (windowLog - ldmHashLog)), optimizing hash table usage.
157157
// Larger values improve compression speed.
158158
// Deviating far from default value will likely result in a compression ratio decrease.
159159
// Special: value 0 means "automatically determine hashRateLog".
160-
zstd_c_ldm_hash_rate_log = 164
160+
zstd_c_ldm_hash_rate_log = 164
161161
// frame parameters
162162
// Content size will be written into frame header _whenever known_ (default:1)
163163
// Content size must be known at the beginning of compression.
164164
// This is automatically the case when using ZSTD_compress2(),
165165
// For streaming scenarios, content size must be provided with ZSTD_CCtx_setPledgedSrcSize()
166-
zstd_c_content_size_flag = 200
166+
zstd_c_content_size_flag = 200
167167
// A 32-bits checksum of content is written at end of frame (default:0)
168-
zstd_c_checksum_flag = 201
168+
zstd_c_checksum_flag = 201
169169
// When applicable, dictionary's ID is written into frame header (default:1)
170-
zstd_c_dict_id_flag = 202
170+
zstd_c_dict_id_flag = 202
171171
// multi-threading parameters
172172
// These parameters are only active if multi-threading is enabled (compiled with build macro ZSTD_MULTITHREAD).
173173
// Otherwise, trying to set any other value than default (0) will be a no-op and return an error.
@@ -183,13 +183,13 @@ pub enum ZSTD_cParameter {
183183
// More workers improve speed, but also increase memory usage.
184184
// Default value is `0`, aka "single-threaded mode" : no worker is spawned,
185185
// compression is performed inside Caller's thread, and all invocations are blocking
186-
zstd_c_nb_workers = 400
186+
zstd_c_nb_workers = 400
187187
// Size of a compression job. This value is enforced only when nbWorkers >= 1.
188188
// Each compression job is completed in parallel, so this value can indirectly impact the nb of active threads.
189189
// 0 means default, which is dynamically determined based on compression parameters.
190190
// Job size must be a minimum of overlap size, or ZSTDMT_JOBSIZE_MIN (= 512 KB), whichever is largest.
191191
// The minimum size is automatically and transparently enforced.
192-
zstd_c_job_size = 401
192+
zstd_c_job_size = 401
193193
// Control the overlap size, as a fraction of window size.
194194
// The overlap size is an amount of data reloaded from previous job at the beginning of a new job.
195195
// It helps preserve compression ratio, while each job is compressed in parallel.
@@ -202,7 +202,7 @@ pub enum ZSTD_cParameter {
202202
// Each intermediate rank increases/decreases load size by a factor 2 :
203203
// 9: full window; 8: w/2; 7: w/4; 6: w/8; 5:w/16; 4: w/32; 3:w/64; 2:w/128; 1:no overlap; 0:default
204204
// default value varies between 6 and 9, depending on strategy
205-
zstd_c_overlap_log = 402
205+
zstd_c_overlap_log = 402
206206
// note : additional experimental parameters are also available
207207
// within the experimental section of the API.
208208
// At the time of this writing, they include :
@@ -227,25 +227,25 @@ pub enum ZSTD_cParameter {
227227
// note : never ever use experimentalParam? names directly;
228228
// also, the enums values themselves are unstable and can still change.
229229
//
230-
zstd_c_experimental_param1 = 500
231-
zstd_c_experimental_param2 = 10
232-
zstd_c_experimental_param3 = 1000
233-
zstd_c_experimental_param4 = 1001
234-
zstd_c_experimental_param5 = 1002
235-
zstd_c_experimental_param6 = 1003
236-
zstd_c_experimental_param7 = 1004
237-
zstd_c_experimental_param8 = 1005
238-
zstd_c_experimental_param9 = 1006
239-
zstd_c_experimental_param10 = 1007
240-
zstd_c_experimental_param11 = 1008
241-
zstd_c_experimental_param12 = 1009
242-
zstd_c_experimental_param13 = 1010
243-
zstd_c_experimental_param14 = 1011
244-
zstd_c_experimental_param15 = 1012
245-
zstd_c_experimental_param16 = 1013
246-
zstd_c_experimental_param17 = 1014
247-
zstd_c_experimental_param18 = 1015
248-
zstd_c_experimental_param19 = 1016
230+
zstd_c_experimental_param1 = 500
231+
zstd_c_experimental_param2 = 10
232+
zstd_c_experimental_param3 = 1000
233+
zstd_c_experimental_param4 = 1001
234+
zstd_c_experimental_param5 = 1002
235+
zstd_c_experimental_param6 = 1003
236+
zstd_c_experimental_param7 = 1004
237+
zstd_c_experimental_param8 = 1005
238+
zstd_c_experimental_param9 = 1006
239+
zstd_c_experimental_param10 = 1007
240+
zstd_c_experimental_param11 = 1008
241+
zstd_c_experimental_param12 = 1009
242+
zstd_c_experimental_param13 = 1010
243+
zstd_c_experimental_param14 = 1011
244+
zstd_c_experimental_param15 = 1012
245+
zstd_c_experimental_param16 = 1013
246+
zstd_c_experimental_param17 = 1014
247+
zstd_c_experimental_param18 = 1015
248+
zstd_c_experimental_param19 = 1016
249249
}
250250

251251
pub struct ZSTD_bounds {
@@ -274,7 +274,7 @@ pub enum ZSTD_dParameter {
274274
// This parameter is only useful in streaming mode, since no internal buffer is allocated in single-pass mode.
275275
// By default, a decompression context accepts window sizes <= (1 << ZSTD_WINDOWLOG_LIMIT_DEFAULT).
276276
// Special: value 0 means "use default maximum windowLog".
277-
zstd_d_window_log_max = 100
277+
zstd_d_window_log_max = 100
278278
// note : additional experimental parameters are also available
279279
// within the experimental section of the API.
280280
// At the time of this writing, they include :
@@ -321,13 +321,13 @@ pub enum ZSTD_EndDirective {
321321
// it creates (at least) one new block, that can be decoded immediately on reception;
322322
// frame will continue: any future data can still reference previously compressed data, improving compression.
323323
// note : multithreaded compression will block to flush as much output as possible.
324-
zstd_e_flush = 1
324+
zstd_e_flush = 1
325325
// flush any remaining data _and_ close current frame.
326326
// note that frame is only closed after compressed data is fully flushed (return value == 0).
327327
// After that point, any additional data starts a new frame.
328328
// note : each frame is independent (does not reference any content from previous frame).
329329
// note : multithreaded compression will block to flush as much output as possible.
330-
zstd_e_end = 2
330+
zstd_e_end = 2
331331
}
332332

333333
fn C.ZSTD_compressStream2(voidptr, &ZSTD_outBuffer, &ZSTD_inBuffer, ZSTD_EndDirective) usize

vlib/db/mysql/enums.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub enum FieldType {
2222
type_timestamp2
2323
type_datetime2
2424
type_time2
25-
type_json = 245
25+
type_json = 245
2626
type_newdecimal
2727
type_enum
2828
type_set

vlib/db/pg/pg.c.v

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -80,34 +80,34 @@ pub struct C.PGresult {}
8080
pub struct C.PGconn {}
8181

8282
pub enum ConnStatusType {
83-
ok = C.CONNECTION_OK
84-
bad = C.CONNECTION_BAD
83+
ok = C.CONNECTION_OK
84+
bad = C.CONNECTION_BAD
8585
// Non-blocking mode only below here
8686
// The existence of these should never be relied upon - they should only be used for user feedback or similar purposes.
87-
started = C.CONNECTION_STARTED // Waiting for connection to be made.
88-
made = C.CONNECTION_MADE // Connection OK; waiting to send.
87+
started = C.CONNECTION_STARTED // Waiting for connection to be made.
88+
made = C.CONNECTION_MADE // Connection OK; waiting to send.
8989
awaiting_response = C.CONNECTION_AWAITING_RESPONSE // Waiting for a response from the postmaster.
90-
auth_ok = C.CONNECTION_AUTH_OK // Received authentication; waiting for backend startup.
91-
setenv = C.CONNECTION_SETENV // Negotiating environment.
92-
ssl_startup = C.CONNECTION_SSL_STARTUP // Negotiating SSL.
93-
needed = C.CONNECTION_NEEDED // Internal state: connect() needed . Available in PG 8
94-
check_writable = C.CONNECTION_CHECK_WRITABLE // Check if we could make a writable connection. Available since PG 10
95-
consume = C.CONNECTION_CONSUME // Wait for any pending message and consume them. Available since PG 10
96-
gss_startup = C.CONNECTION_GSS_STARTUP // Negotiating GSSAPI; available since PG 12
90+
auth_ok = C.CONNECTION_AUTH_OK // Received authentication; waiting for backend startup.
91+
setenv = C.CONNECTION_SETENV // Negotiating environment.
92+
ssl_startup = C.CONNECTION_SSL_STARTUP // Negotiating SSL.
93+
needed = C.CONNECTION_NEEDED // Internal state: connect() needed . Available in PG 8
94+
check_writable = C.CONNECTION_CHECK_WRITABLE // Check if we could make a writable connection. Available since PG 10
95+
consume = C.CONNECTION_CONSUME // Wait for any pending message and consume them. Available since PG 10
96+
gss_startup = C.CONNECTION_GSS_STARTUP // Negotiating GSSAPI; available since PG 12
9797
}
9898

9999
@[typedef]
100100
pub enum ExecStatusType {
101-
empty_query = C.PGRES_EMPTY_QUERY // empty query string was executed
102-
command_ok = C.PGRES_COMMAND_OK // a query command that doesn't return anything was executed properly by the backend
103-
tuples_ok = C.PGRES_TUPLES_OK // a query command that returns tuples was executed properly by the backend, PGresult contains the result tuples
104-
copy_out = C.PGRES_COPY_OUT // Copy Out data transfer in progress
105-
copy_in = C.PGRES_COPY_IN // Copy In data transfer in progress
106-
bad_response = C.PGRES_BAD_RESPONSE // an unexpected response was recv'd from the backend
101+
empty_query = C.PGRES_EMPTY_QUERY // empty query string was executed
102+
command_ok = C.PGRES_COMMAND_OK // a query command that doesn't return anything was executed properly by the backend
103+
tuples_ok = C.PGRES_TUPLES_OK // a query command that returns tuples was executed properly by the backend, PGresult contains the result tuples
104+
copy_out = C.PGRES_COPY_OUT // Copy Out data transfer in progress
105+
copy_in = C.PGRES_COPY_IN // Copy In data transfer in progress
106+
bad_response = C.PGRES_BAD_RESPONSE // an unexpected response was recv'd from the backend
107107
nonfatal_error = C.PGRES_NONFATAL_ERROR // notice or warning message
108-
fatal_error = C.PGRES_FATAL_ERROR // query failed
109-
copy_both = C.PGRES_COPY_BOTH // Copy In/Out data transfer in progress
110-
single_tuple = C.PGRES_SINGLE_TUPLE // single tuple from larger resultset
108+
fatal_error = C.PGRES_FATAL_ERROR // query failed
109+
copy_both = C.PGRES_COPY_BOTH // Copy In/Out data transfer in progress
110+
single_tuple = C.PGRES_SINGLE_TUPLE // single tuple from larger resultset
111111
}
112112

113113
//

0 commit comments

Comments
 (0)