From 6b23454dd1f1c2faf6cf1375350859755d077a13 Mon Sep 17 00:00:00 2001 From: Csaba Hruska Date: Sun, 6 Mar 2016 22:41:35 +0100 Subject: cleanup --- src/LambdaCube/GL/Input.hs | 8 ++++---- src/LambdaCube/GL/Util.hs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/LambdaCube') diff --git a/src/LambdaCube/GL/Input.hs b/src/LambdaCube/GL/Input.hs index 9ceb35f..0471a57 100644 --- a/src/LambdaCube/GL/Input.hs +++ b/src/LambdaCube/GL/Input.hs @@ -78,15 +78,15 @@ addObject :: GLStorage -> String -> Primitive -> Maybe (IndexStream Buffer) -> M addObject input slotName prim indices attribs uniformNames = do let sch = schema input forM_ uniformNames $ \n -> case Map.lookup n (uniforms sch) of - Nothing -> throw $ userError $ "Unknown uniform: " ++ show n + Nothing -> fail $ "Unknown uniform: " ++ show n _ -> return () case Map.lookup slotName (objectArrays sch) of - Nothing -> throw $ userError $ "Unknown slot: " ++ show slotName + Nothing -> fail $ "Unknown slot: " ++ show slotName Just (ObjectArraySchema sPrim sAttrs) -> do - when (sPrim /= (primitiveToFetchPrimitive prim)) $ throw $ userError $ + when (sPrim /= (primitiveToFetchPrimitive prim)) $ fail $ "Primitive mismatch for slot (" ++ show slotName ++ ") expected " ++ show sPrim ++ " but got " ++ show prim let sType = fmap streamToStreamType attribs - when (sType /= sAttrs) $ throw $ userError $ unlines $ + when (sType /= sAttrs) $ fail $ unlines $ [ "Attribute stream mismatch for slot (" ++ show slotName ++ ") expected " , show sAttrs , " but got " diff --git a/src/LambdaCube/GL/Util.hs b/src/LambdaCube/GL/Util.hs index bbc4345..bba322b 100644 --- a/src/LambdaCube/GL/Util.hs +++ b/src/LambdaCube/GL/Util.hs @@ -341,7 +341,7 @@ streamToInputType s = case s of | 0 <= i && i < V.length a && if elem t integralTypes then elem at integralArrTypes else True -> fromStreamType t - | otherwise -> throw $ userError "streamToInputType failed" + | otherwise -> error "streamToInputType failed" where at = arrType $! (a V.! i) integralTypes = [Attribute_Word, Attribute_V2U, Attribute_V3U, Attribute_V4U, Attribute_Int, Attribute_V2I, Attribute_V3I, Attribute_V4I] -- cgit v1.2.3