Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nccf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
702
Provoz
nccf
Commits
1452b910
Commit
1452b910
authored
2 years ago
by
Yorhel
Browse files
Options
Downloads
Patches
Plain Diff
Some fixes for building with Zig stage2
Building is currently broken on packed struct alignment issues. :/
parent
f7e774ee
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/exclude.zig
+4
-4
4 additions, 4 deletions
src/exclude.zig
src/main.zig
+4
-2
4 additions, 2 deletions
src/main.zig
src/ui.zig
+1
-1
1 addition, 1 deletion
src/ui.zig
with
9 additions
and
7 deletions
src/exclude.zig
+
4
−
4
View file @
1452b910
...
@@ -120,7 +120,7 @@ test "parse" {
...
@@ -120,7 +120,7 @@ test "parse" {
// the match result is only used to construct the PatternList of the
// the match result is only used to construct the PatternList of the
// subdirectory) and patterns without a sub-pointer (where the match result
// subdirectory) and patterns without a sub-pointer (where the match result
// determines whether the file/dir at this level should be included or not).
// determines whether the file/dir at this level should be included or not).
fn
PatternList
(
withsub
:
bool
)
type
{
fn
PatternList
(
comptime
withsub
:
bool
)
type
{
return
struct
{
return
struct
{
literals
:
std
.
HashMapUnmanaged
(
*
const
Pattern
,
Val
,
Ctx
,
80
)
=
.
{},
literals
:
std
.
HashMapUnmanaged
(
*
const
Pattern
,
Val
,
Ctx
,
80
)
=
.
{},
wild
:
std
.
ArrayListUnmanaged
(
*
const
Pattern
)
=
.
{},
wild
:
std
.
ArrayListUnmanaged
(
*
const
Pattern
)
=
.
{},
...
@@ -150,7 +150,7 @@ fn PatternList(withsub: bool) type {
...
@@ -150,7 +150,7 @@ fn PatternList(withsub: bool) type {
var
e
=
self
.
literals
.
getOrPut
(
main
.
allocator
,
pat
)
catch
unreachable
;
var
e
=
self
.
literals
.
getOrPut
(
main
.
allocator
,
pat
)
catch
unreachable
;
if
(
!
e
.
found_existing
)
{
if
(
!
e
.
found_existing
)
{
e
.
key_ptr
.*
=
pat
;
e
.
key_ptr
.*
=
pat
;
e
.
value_ptr
.*
=
.
{};
e
.
value_ptr
.*
=
if
(
withsub
)
.
{}
else
{};
}
}
if
(
!
withsub
and
!
pat
.
isdir
and
e
.
key_ptr
.*
.
isdir
)
e
.
key_ptr
.*
=
pat
;
if
(
!
withsub
and
!
pat
.
isdir
and
e
.
key_ptr
.*
.
isdir
)
e
.
key_ptr
.*
=
pat
;
if
(
withsub
)
{
if
(
withsub
)
{
...
@@ -165,14 +165,14 @@ fn PatternList(withsub: bool) type {
...
@@ -165,14 +165,14 @@ fn PatternList(withsub: bool) type {
if
(
self
.
literals
.
getKey
(
&.
{
.
pattern
=
name
}))
|
p
|
ret
=
p
.
isdir
;
if
(
self
.
literals
.
getKey
(
&.
{
.
pattern
=
name
}))
|
p
|
ret
=
p
.
isdir
;
for
(
self
.
wild
.
items
)
|
p
|
{
for
(
self
.
wild
.
items
)
|
p
|
{
if
(
ret
==
false
)
return
ret
;
if
(
ret
==
false
)
return
ret
;
if
(
c
.
fnmatch
(
p
.
pattern
,
name
,
0
)
==
0
)
ret
=
p
.
isdir
;
if
(
c
.
fnmatch
(
p
.
pattern
.
ptr
,
name
.
ptr
,
0
)
==
0
)
ret
=
p
.
isdir
;
}
}
return
ret
;
return
ret
;
}
}
fn
enter
(
self
:
*
const
Self
,
out
:
*
Patterns
,
name
:
[:
0
]
const
u8
)
void
{
fn
enter
(
self
:
*
const
Self
,
out
:
*
Patterns
,
name
:
[:
0
]
const
u8
)
void
{
if
(
self
.
literals
.
get
(
&.
{
.
pattern
=
name
}))
|
lst
|
for
(
lst
.
items
)
|
sub
|
out
.
append
(
sub
);
if
(
self
.
literals
.
get
(
&.
{
.
pattern
=
name
}))
|
lst
|
for
(
lst
.
items
)
|
sub
|
out
.
append
(
sub
);
for
(
self
.
wild
.
items
)
|
p
|
if
(
c
.
fnmatch
(
p
.
pattern
,
name
,
0
)
==
0
)
out
.
append
(
p
.
sub
.?
);
for
(
self
.
wild
.
items
)
|
p
|
if
(
c
.
fnmatch
(
p
.
pattern
.
ptr
,
name
.
ptr
,
0
)
==
0
)
out
.
append
(
p
.
sub
.?
);
}
}
fn
deinit
(
self
:
*
Self
)
void
{
fn
deinit
(
self
:
*
Self
)
void
{
...
...
This diff is collapsed.
Click to expand it.
src/main.zig
+
4
−
2
View file @
1452b910
...
@@ -261,7 +261,8 @@ fn tryReadArgsFile(path: [:0]const u8) void {
...
@@ -261,7 +261,8 @@ fn tryReadArgsFile(path: [:0]const u8) void {
defer
f
.
close
();
defer
f
.
close
();
var
arglist
=
std
.
ArrayList
([:
0
]
const
u8
).
init
(
allocator
);
var
arglist
=
std
.
ArrayList
([:
0
]
const
u8
).
init
(
allocator
);
var
rd
=
std
.
io
.
bufferedReader
(
f
.
reader
()).
reader
();
var
rd_
=
std
.
io
.
bufferedReader
(
f
.
reader
());
var
rd
=
rd_
.
reader
();
var
linebuf
:
[
4096
]
u8
=
undefined
;
var
linebuf
:
[
4096
]
u8
=
undefined
;
while
(
while
(
...
@@ -379,7 +380,8 @@ fn spawnShell() void {
...
@@ -379,7 +380,8 @@ fn spawnShell() void {
fn
readExcludeFile
(
path
:
[:
0
]
const
u8
)
!
void
{
fn
readExcludeFile
(
path
:
[:
0
]
const
u8
)
!
void
{
const
f
=
try
std
.
fs
.
cwd
().
openFileZ
(
path
,
.
{});
const
f
=
try
std
.
fs
.
cwd
().
openFileZ
(
path
,
.
{});
defer
f
.
close
();
defer
f
.
close
();
var
rd
=
std
.
io
.
bufferedReader
(
f
.
reader
()).
reader
();
var
rd_
=
std
.
io
.
bufferedReader
(
f
.
reader
());
var
rd
=
rd_
.
reader
();
var
buf
=
std
.
ArrayList
(
u8
).
init
(
allocator
);
var
buf
=
std
.
ArrayList
(
u8
).
init
(
allocator
);
defer
buf
.
deinit
();
defer
buf
.
deinit
();
while
(
true
)
{
while
(
true
)
{
...
...
This diff is collapsed.
Click to expand it.
src/ui.zig
+
1
−
1
View file @
1452b910
...
@@ -395,7 +395,7 @@ pub fn move(y: u32, x: u32) void {
...
@@ -395,7 +395,7 @@ pub fn move(y: u32, x: u32) void {
// (Well, addchstr() does that, but not entirely sure I want to go that way.
// (Well, addchstr() does that, but not entirely sure I want to go that way.
// Does that even work with UTF-8? Or do I really need to go wchar madness?)
// Does that even work with UTF-8? Or do I really need to go wchar madness?)
pub
fn
addstr
(
s
:
[:
0
]
const
u8
)
void
{
pub
fn
addstr
(
s
:
[:
0
]
const
u8
)
void
{
_
=
c
.
addstr
(
s
);
_
=
c
.
addstr
(
s
.
ptr
);
}
}
// Not to be used for strings that may end up >256 bytes.
// Not to be used for strings that may end up >256 bytes.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment