on master help sign in
Made conversion to CInt param explicit
commit39042f3079b82fafa76f40c5f52f857834c655ac authorgmorpheme <github@gmorpheme.net> dateTue 5 Feb 2019, 15:12 (8 years ago) parent4da1f0c
1 file changed+7−3
libyaml/src/Text/Libyaml.hs+7−3
libyaml/src/Text/Libyaml.hs+7−3
@@ -559,13 +559,13 @@ toEventRaw opts e f = allocaBytes eventSize $ \er -> do
559559 implicitColl (EventSequenceStart NoTag _ _) = 1
560560 implicitColl (EventMappingStart (UriTag "") _ _) = 1
561561 implicitColl (EventSequenceStart (UriTag "") _ _) = 1
562− implicitColl evt = toEnum $ fromEnum $ formatOptionsRenderCollectionTags opts evt
562+ implicitColl evt = toImplicitParam $ formatOptionsRenderCollectionTags opts evt
563563 implicitPlain (EventScalar _ NoTag _ _) = 1
564564 implicitPlain (EventScalar _ (UriTag "") _ _) = 1
565− implicitPlain evt = toEnum $ fromEnum $ formatOptionsRenderPlainScalarTags opts evt
565+ implicitPlain evt = toImplicitParam $ formatOptionsRenderPlainScalarTags opts evt
566566 implicitQuoted (EventScalar _ NoTag _ _) = 1
567567 implicitQuoted (EventScalar _ (UriTag "") _ _) = 1
568− implicitQuoted evt = toEnum $ fromEnum $ formatOptionsRenderQuotedScalarTags opts evt
568+ implicitQuoted evt = toImplicitParam $ formatOptionsRenderQuotedScalarTags opts evt
569569
570570newtype ToEventRawException = ToEventRawException CInt
571571 deriving (Show, Typeable)
@@ -689,6 +689,10 @@ parserParseOne' parser = allocaBytes eventSize $ \er -> do
689689data TagRender = Explicit | Implicit
690690 deriving (Enum)
691691
692+toImplicitParam :: TagRender -> CInt
693+toImplicitParam Explicit = 0
694+toImplicitParam _ = 1
695+
692696-- | A value for 'formatOptionsRenderCollectionTags' that renders no
693697-- tags.
694698--