Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/c-target/gen-output.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/c-target/gen-output.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1861, Sat Apr 21 15:30:26 2012 UTC revision 1862, Sun Apr 22 19:45:47 2012 UTC
# Line 140  Line 140 
140    
141    (* code fragment to allocate nrrd data and check for errors    (* code fragment to allocate nrrd data and check for errors
142          if (nrrdMaybeAlloc_nva(<nrrdVar>, <nrrdType>, <nDims>, sizes) != 0) {          if (nrrdMaybeAlloc_nva(<nrrdVar>, <nrrdType>, <nDims>, sizes) != 0) {
143              wrld->err = biffGetDone(NRRD);              char *msg = biffGetDone(NRRD);
144                biffMsgAdd (wrld->errors, msg);
145                FREE (msg);
146              return true;              return true;
147          }          }
148     *)     *)
# Line 154  Line 156 
156                CL.mkInt 0),                CL.mkInt 0),
157            (* then *)            (* then *)
158              CL.mkBlock[              CL.mkBlock[
159                  CL.mkAssign(CL.mkIndirect(wrldV, "err"),                  CL.mkDeclInit(CL.charPtr, "msg", CL.mkApply("biffGetDone", [NRRD])),
160                    CL.mkApply("biffGetDone", [NRRD])),                  CL.mkCall("biffMsgAdd", [CL.mkIndirect(wrldV, "errors"), CL.mkVar "msg"]),
161                    CL.mkCall("FREE", [CL.mkVar "msg"]),
162                  CL.mkReturn(SOME(CL.mkVar "true"))                  CL.mkReturn(SOME(CL.mkVar "true"))
163                ]                ]
164            (* endif*))            (* endif*))
# Line 349  Line 352 
352    (* generate the nrrd-file output and print functions used by standalone executables *)    (* generate the nrrd-file output and print functions used by standalone executables *)
353      fun genOutput (tgt : TargetUtil.target_desc, outputs) = let      fun genOutput (tgt : TargetUtil.target_desc, outputs) = let
354            fun isDyn ty = (case ty of Ty.DynSeqTy _ => true | _ => false)            fun isDyn ty = (case ty of Ty.DynSeqTy _ => true | _ => false)
355    (* FIXME: use biffMsgAddF and return error status *)
356            fun error (fmt, msg) = CL.mkBlock[            fun error (fmt, msg) = CL.mkBlock[
357                    CL.mkCall("fprintf", [CL.mkVar "stderr", CL.mkStr fmt, msg]),                    CL.mkCall("fprintf", [CL.mkVar "stderr", CL.mkStr fmt, msg]),
358                    CL.mkCall("exit", [CL.mkInt 1])                    CL.mkCall("exit", [CL.mkInt 1])

Legend:
Removed from v.1861  
changed lines
  Added in v.1862

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0