From 0956719726f444f5e6c3c7e34fc6f7745756e2f8 Mon Sep 17 00:00:00 2001 From: Maor Itzkovitch Date: Fri, 7 Aug 2015 18:35:28 +0300 Subject: [PATCH] added comments --- src/idl_gen_general.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/idl_gen_general.cpp b/src/idl_gen_general.cpp index 81c0b5b77..faa97059a 100644 --- a/src/idl_gen_general.cpp +++ b/src/idl_gen_general.cpp @@ -330,6 +330,10 @@ static std::string DestinationValue(const LanguageParameters &lang, } } +// Cast statements for mutator method parameters. +// In Java, parameters representing unsigned numbers need to be cast down to their respective type. +// For example, a long holding an unsigned int value would be cast down to int before being put onto the buffer. +// In C#, one cast directly cast an Enum to its underlying type, which is essential before putting it onto the buffer. static std::string SourceCast(const LanguageParameters &lang, const Type &type) { switch (lang.language) {