Skip to content

Commit

Permalink
set most errornous to pub
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Apr 4, 2024
1 parent 0733eb3 commit 47ca871
Show file tree
Hide file tree
Showing 26 changed files with 35 additions and 4 deletions.
1 change: 1 addition & 0 deletions vlib/compress/szip/szip.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import os

@[params]
pub struct ZipFolderOptions {
pub:
omit_empty_folders bool
}

Expand Down
1 change: 1 addition & 0 deletions vlib/dl/loader/loader.v
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ mut:
// DynamicLibLoaderConfig is a configuration for DynamicLibLoader.
@[params]
pub struct DynamicLibLoaderConfig {
pub:
// flags is the flags for dlopen.
flags int = dl.rtld_lazy
// key is the key to register the DynamicLibLoader.
Expand Down
1 change: 1 addition & 0 deletions vlib/dlmalloc/dlmalloc.v
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ fn overhead_for(c &Chunk) usize {
//
// Why not `interface?` Interfaces require memory allocation so it is simpler to pass a struct.
pub struct Allocator {
pub:
alloc fn (voidptr, usize) (voidptr, usize, u32) = unsafe { nil }
remap fn (voidptr, voidptr, usize, usize, bool) voidptr = unsafe { nil }
free_part fn (voidptr, voidptr, usize, usize) bool = unsafe { nil }
Expand Down
2 changes: 2 additions & 0 deletions vlib/encoding/csv/README_csv_reader.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Using these structs, it is possible to change the behavior of the CSV Reader.
The config struct is as follows:
```v ignore
pub struct SequentialReaderConfig {
pub:
scr_buf voidptr // pointer to the buffer of data
scr_buf_len i64 // if > 0 use the RAM pointed by scr_buf as source of data
file_path string
Expand Down Expand Up @@ -128,6 +129,7 @@ Using these structs, it is possible to change the behavior of the CSV Reader.
The config struct is as follows:
```v ignore
pub struct RandomAccessReaderConfig {
pub:
scr_buf voidptr // pointer to the buffer of data
scr_buf_len i64 // if > 0 use the RAM pointed from scr_buf as source of data
file_path string
Expand Down
2 changes: 2 additions & 0 deletions vlib/encoding/csv/csv_reader_random_access.v
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ pub mut:

@[params]
pub struct RandomAccessReaderConfig {
pub:
scr_buf voidptr // pointer to the buffer of data
scr_buf_len i64 // if > 0 use the RAM pointed from scr_buf as source of data
file_path string
Expand Down Expand Up @@ -344,6 +345,7 @@ pub fn (mut cr RandomAccessReader) get_row(y int) ![]string {

@[params]
pub struct GetCellConfig {
pub:
x int
y int
}
Expand Down
1 change: 1 addition & 0 deletions vlib/encoding/csv/csv_reader_sequential.v
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import os

@[params]
pub struct SequentialReaderConfig {
pub:
scr_buf voidptr // pointer to the buffer of data
scr_buf_len i64 // if > 0 use the RAM pointed by scr_buf as source of data
file_path string
Expand Down
1 change: 1 addition & 0 deletions vlib/encoding/csv/reader.v
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ mut:

@[params]
pub struct ReaderConfig {
pub:
delimiter u8 = `,`
comment u8 = `#`
}
Expand Down
2 changes: 2 additions & 0 deletions vlib/encoding/html/escape.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ import strconv

@[params]
pub struct EscapeConfig {
pub:
quote bool = true
}

@[params]
pub struct UnescapeConfig {
EscapeConfig
pub:
all bool
}

Expand Down
2 changes: 2 additions & 0 deletions vlib/encoding/xml/entity.v
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub const default_entities_reverse = {

@[params]
pub struct EscapeConfig {
pub:
reverse_entities map[string]string = xml.default_entities_reverse
}

Expand All @@ -38,6 +39,7 @@ pub fn escape_text(content string, config EscapeConfig) string {

@[params]
pub struct UnescapeConfig {
pub:
entities map[string]string = xml.default_entities
}

Expand Down
4 changes: 4 additions & 0 deletions vlib/encoding/xml/types.v
Original file line number Diff line number Diff line change
Expand Up @@ -37,21 +37,25 @@ pub:
pub type DTDListItem = DTDElement | DTDEntity

pub struct DTDEntity {
pub:
name string @[required]
value string @[required]
}

pub struct DTDElement {
pub:
name string @[required]
definition []string @[required]
}

pub struct DocumentTypeDefinition {
pub:
name string
list []DTDListItem
}

pub struct DocumentType {
pub:
name string @[required]
dtd DTDInfo
}
Expand Down
1 change: 1 addition & 0 deletions vlib/gg/image.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@ pub fn (mut ctx Context) create_image_from_byte_array(b []u8) !Image {
}

pub struct StreamingImageConfig {
pub:
pixel_format gfx.PixelFormat = .rgba8
wrap_u gfx.Wrap = .clamp_to_edge
wrap_v gfx.Wrap = .clamp_to_edge
Expand Down
2 changes: 1 addition & 1 deletion vlib/io/reader.v
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub const read_all_grow_len = 1024
// of read_all.
pub struct ReadAllConfig {
read_to_end_of_stream bool
mut:
pub:
reader Reader
}

Expand Down
1 change: 1 addition & 0 deletions vlib/io/util/util.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const retries = 10000

@[params]
pub struct TempFileOptions {
pub:
path string = os.temp_dir()
pattern string
}
Expand Down
1 change: 1 addition & 0 deletions vlib/net/websocket/websocket_server.v
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub mut:

@[params]
pub struct ServerOpt {
pub:
logger &log.Logger = &log.Logger(&log.Log{
level: .info
})
Expand Down
1 change: 1 addition & 0 deletions vlib/szip/szip.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import os

@[params]
pub struct ZipFolderOptions {
pub:
omit_empty_folders bool
}

Expand Down
1 change: 1 addition & 0 deletions vlib/time/stopwatch.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ module time

@[params]
pub struct StopWatchOptions {
pub:
auto_start bool = true
}

Expand Down
1 change: 1 addition & 0 deletions vlib/time/time.c.v
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ module time

// C.timeval represents a C time value.
pub struct C.timeval {
pub:
tv_sec u64
tv_usec u64
}
Expand Down
3 changes: 3 additions & 0 deletions vlib/toml/toml.v
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ fn to_any[T](value T) Any {

// DateTime is the representation of an RFC 3339 datetime string.
pub struct DateTime {
pub:
datetime string
}

Expand All @@ -213,6 +214,7 @@ pub fn (dt DateTime) str() string {

// Date is the representation of an RFC 3339 date-only string.
pub struct Date {
pub:
date string
}

Expand All @@ -223,6 +225,7 @@ pub fn (d Date) str() string {

// Time is the representation of an RFC 3339 time-only string.
pub struct Time {
pub:
time string
}

Expand Down
3 changes: 1 addition & 2 deletions vlib/v/checker/struct.v
Original file line number Diff line number Diff line change
Expand Up @@ -741,8 +741,7 @@ or use an explicit `unsafe{ a[..] }`, if you do not want a copy of the slice.',
for i, mut field in fields {
if field.name in inited_fields {
if c.mod != type_sym.mod {
// TODO: fix marking fields as pub on interop structs.
if !field.is_pub && type_sym.language == .v {
if !field.is_pub {
parts := type_sym.name.split('.')
mod_type := if parts.len > 1 {
parts#[-2..].join('.')
Expand Down
1 change: 1 addition & 0 deletions vlib/v/eval/eval.v
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ pub fn (mut e Eval) run(expression string, args ...Object) ![]Object {
type Symbol = Object | ast.EmptyStmt | ast.FnDecl

pub struct Eval {
pub:
pref &pref.Preferences = unsafe { nil }
pub mut:
table &ast.Table = unsafe { nil }
Expand Down
1 change: 1 addition & 0 deletions vlib/v/fmt/fmt.v
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const bs = '\\'

@[minify]
pub struct Fmt {
pub:
pref &pref.Preferences = unsafe { nil }
pub mut:
file ast.File
Expand Down
1 change: 1 addition & 0 deletions vlib/v/help/help.v
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ fn help_dir() string {

@[params]
pub struct ExitOptions {
pub:
exit_code int
}

Expand Down
2 changes: 1 addition & 1 deletion vlib/v/tests/generics_from_modules/newmodule/newmodule.v
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module newmodule

pub struct Params[T] {
mut:
pub mut:
a []T
b int
c T
Expand Down
1 change: 1 addition & 0 deletions vlib/x/json2/strict/strict.v
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub enum KeyType {
}

pub struct StructCheckResult {
pub:
duplicates []string
superfluous []string
}
Expand Down
1 change: 1 addition & 0 deletions vlib/x/vweb/middleware.v
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ mut:

@[params]
pub struct MiddlewareOptions[T] {
pub:
handler fn (mut ctx T) bool @[required]
after bool
}
Expand Down
1 change: 1 addition & 0 deletions vlib/x/vweb/vweb.v
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ pub fn run[A, X](mut global_app A, port int) {

@[params]
pub struct RunParams {
pub:
// use `family: .ip, host: 'localhost'` when you want it to bind only to 127.0.0.1
family net.AddrFamily = .ip6
host string
Expand Down

0 comments on commit 47ca871

Please sign in to comment.