File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 2424 stationsDir: string
2525 version: string # Application version
2626
27- var state = new StderrState
27+ var state: StderrState
2828
2929const
3030 AppName = " Poor Man's Radio Player" # Name of the application
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ template checkError(status: cint) =
4444template cE (status: cint ) =
4545 checkError (status)
4646
47- proc initSuppressStderr * (state: ref StderrState ) =
47+ proc initSuppressStderr * (state: var StderrState ) =
4848 when win32: state.originalStderrFd = c_dup (c_fileno (stderr))
4949 else : state.originalStderrFd = c_dup (c_fileno (stderr))
5050
@@ -56,7 +56,7 @@ proc initSuppressStderr*(state: ref StderrState) =
5656 error (" failed to suppress stderr" )
5757 quit (QuitFailure )
5858
59- proc restoreStderr * (state: ref StderrState ) =
59+ proc restoreStderr * (state: var StderrState ) =
6060 flushFile (stderr)
6161
6262 when win32:
@@ -79,7 +79,7 @@ proc restoreStderr*(state: ref StderrState) =
7979 else : cE c_dup2 (c_fileno (stdout), c_fileno (stderr))
8080
8181when isMainModule :
82- var state = new StderrState
82+ var state: StderrState
8383 echo (" this goes to stdout" )
8484
8585 state.initSuppressStderr ()
You can’t perform that action at this time.
0 commit comments