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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/c-util/gen-load-nrrd.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/c-util/gen-load-nrrd.sml

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

revision 2708, Sat Sep 20 18:46:49 2014 UTC revision 2719, Tue Sep 23 17:51:53 2014 UTC
# Line 34  Line 34 
34      val wrldPrefixTy = CL.T_Ptr(CL.T_Named "WorldPrefix_t")      val wrldPrefixTy = CL.T_Ptr(CL.T_Named "WorldPrefix_t")
35    
36      fun doImage imageFn (lhs, info, arg) = let      fun doImage imageFn (lhs, info, arg) = let
           val sts = "_sts"  
37            val dim = ImageInfo.dim info            val dim = ImageInfo.dim info
38            in CL.mkBlock [            val loadExp = CL.mkApply(imageFn dim, [
             CL.mkDecl(  
               CL.T_Named N.statusTy, sts,  
               SOME(CL.I_Exp(CL.mkApply(imageFn dim, [  
39                    CL.mkCast(wrldPrefixTy, CL.mkVar "wrld"),                    CL.mkCast(wrldPrefixTy, CL.mkVar "wrld"),
40                    arg,                    arg,
41                    CL.mkUnOp(CL.%&, lhs)                    CL.mkUnOp(CL.%&, lhs)
42                  ])))),                  ])
43              in
44  (* FIXME: we should also generate code to check that the loaded image has the right type, etc. *)  (* FIXME: we should also generate code to check that the loaded image has the right type, etc. *)
45              CL.mkIfThen(              CL.mkIfThen(loadExp, CL.mkReturn(SOME(CL.mkVar "true")))
46                CL.mkBinOp(CL.mkVar "DIDEROT_OK", CL.#!=, CL.mkVar sts),            end
               CL.mkReturn(SOME(CL.mkVar "true")))  
           ] end  
47    
48    
49      val loadImage = doImage N.loadImage      val loadImage = doImage N.loadImage

Legend:
Removed from v.2708  
changed lines
  Added in v.2719

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