BUGFIX reflect default argument promotions in va_* function
char and short variadic arguments automatically promotes to int. This
must be reflected in va_arg() and the int type is supposed to be used
as type to obtain instead of the original type.
Furthermore, the last non-variadic argument cannot be regiter variable,
function, array or automatically promoted type.
In same case, we are using enum type as the last non-variadic and variadic
arguments and above restrictins were not reflected. Even that the
enum is represented as int on common architectures / by common compilers,
the restrictions should be reflected.
Fixes #12
diff --git a/src/session_p.h b/src/session_p.h
index ec4508f..e558a44 100644
--- a/src/session_p.h
+++ b/src/session_p.h
@@ -564,7 +564,7 @@
* @brief Write message into wire.
*
* @param[in] session NETCONF session to which the message will be written.
- * @param[in] type Type of the message to write. According to the type, the
+ * @param[in] type The type of the message to write, specified as #NC_MSG_TYPE value. According to the type, the
* specific additional parameters are required or accepted:
* - #NC_MSG_RPC
* - `struct lyd_node *op;` - operation (content of the \<rpc/\> to be sent. Required parameter.
@@ -579,7 +579,7 @@
* - TODO: content
* @return 0 on success
*/
-int nc_write_msg(struct nc_session *session, NC_MSG_TYPE type, ...);
+int nc_write_msg(struct nc_session *session, int type, ...);
/**
* @brief Check whether a session is still connected (on transport layer).