fix "Casting operation to a pointer"

The print_param struct's member emit who is used for callback,
the forth parameter of it is used for transmit the private data
of the "print_param".

The type translation between "void *" and private date broke the
violations.

Use the same type to fix it out.

Tracked-On: #861
Signed-off-by: Huihuang Shi <huihuang.shi@intel.com>
Acked-by: Xu Anthony <anthony.xu@intel.com>
This commit is contained in:
Huihuang Shi
2018-11-05 10:40:50 +08:00
committed by lijinxia
parent ad1e2ab678
commit a2516ecc85
3 changed files with 24 additions and 25 deletions

View File

@@ -47,16 +47,6 @@
/** The value is interpreted as unsigned. */
#define PRINT_FLAG_UINT32 0x00000400U
/** Structure used to save (v)snprintf() specific values */
struct snprint_param {
/** The destination buffer. */
char *dst;
/** The size of the destination buffer. */
uint32_t sz;
/** Counter for written chars. */
uint32_t wrtn;
};
/** The characters to use for upper case hexadecimal conversion.
*
* Note that this array is 17 bytes long. The first 16 characters
@@ -551,11 +541,10 @@ void do_print(const char *fmt_arg, struct print_param *param,
}
static void charmem(size_t cmd, const char *s_arg, uint32_t sz, void *hnd)
static void
charmem(size_t cmd, const char *s_arg, uint32_t sz, struct snprint_param *param)
{
const char *s = s_arg;
/* pointer to the snprint parameter list */
struct snprint_param *param = (struct snprint_param *) hnd;
/* pointer to the destination */
char *p = param->dst + param->wrtn;
/* characters actually written */