refactor(lib): mark pointers as const where possible (#2140)
This commit is contained in:
@@ -848,7 +848,7 @@ uc_err uc_reg_read2(uc_engine *uc, int regid, void *value, size_t *size);
|
|||||||
invalid
|
invalid
|
||||||
*/
|
*/
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_reg_write_batch(uc_engine *uc, int *regs, void *const *vals,
|
uc_err uc_reg_write_batch(uc_engine *uc, int const *regs, void *const *vals,
|
||||||
int count);
|
int count);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -863,7 +863,8 @@ uc_err uc_reg_write_batch(uc_engine *uc, int *regs, void *const *vals,
|
|||||||
invalid
|
invalid
|
||||||
*/
|
*/
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_reg_read_batch(uc_engine *uc, int *regs, void **vals, int count);
|
uc_err uc_reg_read_batch(uc_engine *uc, int const *regs, void **vals,
|
||||||
|
int count);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Write multiple register values.
|
Write multiple register values.
|
||||||
@@ -879,8 +880,8 @@ uc_err uc_reg_read_batch(uc_engine *uc, int *regs, void **vals, int count);
|
|||||||
corresponding register.
|
corresponding register.
|
||||||
*/
|
*/
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_reg_write_batch2(uc_engine *uc, int *regs, const void *const *vals,
|
uc_err uc_reg_write_batch2(uc_engine *uc, int const *regs,
|
||||||
size_t *sizes, int count);
|
const void *const *vals, size_t *sizes, int count);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Read multiple register values.
|
Read multiple register values.
|
||||||
@@ -897,7 +898,7 @@ uc_err uc_reg_write_batch2(uc_engine *uc, int *regs, const void *const *vals,
|
|||||||
corresponding register.
|
corresponding register.
|
||||||
*/
|
*/
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_reg_read_batch2(uc_engine *uc, int *regs, void *const *vals,
|
uc_err uc_reg_read_batch2(uc_engine *uc, int const *regs, void *const *vals,
|
||||||
size_t *sizes, int count);
|
size_t *sizes, int count);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1278,8 +1279,8 @@ uc_err uc_context_reg_read2(uc_context *ctx, int regid, void *value,
|
|||||||
for detailed error).
|
for detailed error).
|
||||||
*/
|
*/
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_context_reg_write_batch(uc_context *ctx, int *regs, void *const *vals,
|
uc_err uc_context_reg_write_batch(uc_context *ctx, int const *regs,
|
||||||
int count);
|
void *const *vals, int count);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Read multiple register values from a context.
|
Read multiple register values from a context.
|
||||||
@@ -1293,7 +1294,7 @@ uc_err uc_context_reg_write_batch(uc_context *ctx, int *regs, void *const *vals,
|
|||||||
for detailed error).
|
for detailed error).
|
||||||
*/
|
*/
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_context_reg_read_batch(uc_context *ctx, int *regs, void **vals,
|
uc_err uc_context_reg_read_batch(uc_context *ctx, int const *regs, void **vals,
|
||||||
int count);
|
int count);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1310,7 +1311,7 @@ uc_err uc_context_reg_read_batch(uc_context *ctx, int *regs, void **vals,
|
|||||||
corresponding register.
|
corresponding register.
|
||||||
*/
|
*/
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_context_reg_write_batch2(uc_context *ctx, int *regs,
|
uc_err uc_context_reg_write_batch2(uc_context *ctx, int const *regs,
|
||||||
const void *const *vals, size_t *sizes,
|
const void *const *vals, size_t *sizes,
|
||||||
int count);
|
int count);
|
||||||
|
|
||||||
@@ -1329,8 +1330,8 @@ uc_err uc_context_reg_write_batch2(uc_context *ctx, int *regs,
|
|||||||
corresponding register.
|
corresponding register.
|
||||||
*/
|
*/
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_context_reg_read_batch2(uc_context *ctx, int *regs, void *const *vals,
|
uc_err uc_context_reg_read_batch2(uc_context *ctx, int const *regs,
|
||||||
size_t *sizes, int count);
|
void *const *vals, size_t *sizes, int count);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Restore the current CPU context from a saved copy.
|
Restore the current CPU context from a saved copy.
|
||||||
|
|||||||
22
uc.c
22
uc.c
@@ -572,7 +572,7 @@ uc_err uc_close(uc_engine *uc)
|
|||||||
}
|
}
|
||||||
|
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_reg_read_batch(uc_engine *uc, int *regs, void **vals, int count)
|
uc_err uc_reg_read_batch(uc_engine *uc, int const *regs, void **vals, int count)
|
||||||
{
|
{
|
||||||
UC_INIT(uc);
|
UC_INIT(uc);
|
||||||
reg_read_t reg_read = uc->reg_read;
|
reg_read_t reg_read = uc->reg_read;
|
||||||
@@ -596,7 +596,7 @@ uc_err uc_reg_read_batch(uc_engine *uc, int *regs, void **vals, int count)
|
|||||||
}
|
}
|
||||||
|
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_reg_write_batch(uc_engine *uc, int *regs, void *const *vals,
|
uc_err uc_reg_write_batch(uc_engine *uc, int const *regs, void *const *vals,
|
||||||
int count)
|
int count)
|
||||||
{
|
{
|
||||||
UC_INIT(uc);
|
UC_INIT(uc);
|
||||||
@@ -627,7 +627,7 @@ uc_err uc_reg_write_batch(uc_engine *uc, int *regs, void *const *vals,
|
|||||||
}
|
}
|
||||||
|
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_reg_read_batch2(uc_engine *uc, int *regs, void *const *vals,
|
uc_err uc_reg_read_batch2(uc_engine *uc, int const *regs, void *const *vals,
|
||||||
size_t *sizes, int count)
|
size_t *sizes, int count)
|
||||||
{
|
{
|
||||||
UC_INIT(uc);
|
UC_INIT(uc);
|
||||||
@@ -651,8 +651,8 @@ uc_err uc_reg_read_batch2(uc_engine *uc, int *regs, void *const *vals,
|
|||||||
}
|
}
|
||||||
|
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_reg_write_batch2(uc_engine *uc, int *regs, const void *const *vals,
|
uc_err uc_reg_write_batch2(uc_engine *uc, int const *regs,
|
||||||
size_t *sizes, int count)
|
const void *const *vals, size_t *sizes, int count)
|
||||||
{
|
{
|
||||||
UC_INIT(uc);
|
UC_INIT(uc);
|
||||||
reg_write_t reg_write = uc->reg_write;
|
reg_write_t reg_write = uc->reg_write;
|
||||||
@@ -2344,8 +2344,8 @@ uc_err uc_context_reg_read2(uc_context *ctx, int regid, void *value,
|
|||||||
}
|
}
|
||||||
|
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_context_reg_write_batch(uc_context *ctx, int *regs, void *const *vals,
|
uc_err uc_context_reg_write_batch(uc_context *ctx, int const *regs,
|
||||||
int count)
|
void *const *vals, int count)
|
||||||
{
|
{
|
||||||
reg_write_t reg_write = find_context_reg_rw(ctx->arch, ctx->mode).write;
|
reg_write_t reg_write = find_context_reg_rw(ctx->arch, ctx->mode).write;
|
||||||
void *env = ctx->data;
|
void *env = ctx->data;
|
||||||
@@ -2367,7 +2367,7 @@ uc_err uc_context_reg_write_batch(uc_context *ctx, int *regs, void *const *vals,
|
|||||||
}
|
}
|
||||||
|
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_context_reg_read_batch(uc_context *ctx, int *regs, void **vals,
|
uc_err uc_context_reg_read_batch(uc_context *ctx, int const *regs, void **vals,
|
||||||
int count)
|
int count)
|
||||||
{
|
{
|
||||||
reg_read_t reg_read = find_context_reg_rw(ctx->arch, ctx->mode).read;
|
reg_read_t reg_read = find_context_reg_rw(ctx->arch, ctx->mode).read;
|
||||||
@@ -2389,7 +2389,7 @@ uc_err uc_context_reg_read_batch(uc_context *ctx, int *regs, void **vals,
|
|||||||
}
|
}
|
||||||
|
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_context_reg_write_batch2(uc_context *ctx, int *regs,
|
uc_err uc_context_reg_write_batch2(uc_context *ctx, int const *regs,
|
||||||
const void *const *vals, size_t *sizes,
|
const void *const *vals, size_t *sizes,
|
||||||
int count)
|
int count)
|
||||||
{
|
{
|
||||||
@@ -2412,8 +2412,8 @@ uc_err uc_context_reg_write_batch2(uc_context *ctx, int *regs,
|
|||||||
}
|
}
|
||||||
|
|
||||||
UNICORN_EXPORT
|
UNICORN_EXPORT
|
||||||
uc_err uc_context_reg_read_batch2(uc_context *ctx, int *regs, void *const *vals,
|
uc_err uc_context_reg_read_batch2(uc_context *ctx, int const *regs,
|
||||||
size_t *sizes, int count)
|
void *const *vals, size_t *sizes, int count)
|
||||||
{
|
{
|
||||||
reg_read_t reg_read = find_context_reg_rw(ctx->arch, ctx->mode).read;
|
reg_read_t reg_read = find_context_reg_rw(ctx->arch, ctx->mode).read;
|
||||||
void *env = ctx->data;
|
void *env = ctx->data;
|
||||||
|
|||||||
Reference in New Issue
Block a user