Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Show more breadcrumbs
Gesh
GHC
Commits
dcfe9a1f
Commit
dcfe9a1f
authored
27 years ago
by
sof
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1998-02-09 13:02:15 by sof]
Remove IO exception compat. cruft
parent
7cd31df2
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/compiler/utils/StringBuffer.lhs
+3
-5
3 additions, 5 deletions
ghc/compiler/utils/StringBuffer.lhs
with
3 additions
and
5 deletions
ghc/compiler/utils/StringBuffer.lhs
+
3
−
5
View file @
dcfe9a1f
...
...
@@ -105,7 +105,6 @@ instance Text StringBuffer where
\begin{code}
hGetStringBuffer :: FilePath -> IO StringBuffer
hGetStringBuffer fname =
-- trace ("Renamer: opening " ++ fname) $
openFile fname ReadMode >>= \ hndl ->
hFileSize hndl >>= \ len@(J# _ _ d#) ->
let len_i = fromInteger len in
...
...
@@ -114,7 +113,7 @@ hGetStringBuffer fname =
-- trace (show ((len_i::Int)+1)) $
_casm_ `` %r=(char *)malloc(sizeof(char)*(int)%0); '' (len_i::Int) >>= \ arr@(A# a#) ->
if addr2Int# a# ==# 0# then
fail
With MkIOError(hndl,U
serError
,
("hGetStringBuffer: Could not allocate "++show len_i ++ " bytes"))
fail
(u
serError
("hGetStringBuffer: Could not allocate "++show len_i ++ " bytes"))
else
-- _casm_ `` %r=NULL; '' >>= \ free_p ->
...
...
@@ -123,10 +122,9 @@ hGetStringBuffer fname =
writeHandle hndl hndl_ >>
let ptr = filePtr hndl_ in
_ccall_ fread arr (1::Int) len_i ptr >>= \ (I# read#) ->
-- trace ("DEBUG: opened " ++ fname ++ show (I# read#)) $
hClose hndl >>
if read# ==# 0# then -- EOF or other error
fail
With MkIOError(hndl,U
serError
,
"hGetStringBuffer:
EOF reached or some other error"
)
if read# ==# 0# then -- EOF or
some
other error
fail
(u
serError
(
"hGetStringBuffer:
failed to slurp in interface file "++fname)
)
else
-- Add a sentinel NUL
_casm_ `` ((char *)%0)[(int)%1]=(char)0; '' arr (I# (read# -# 1#)) >>= \ () ->
...
...
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