summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-12-13 11:17:58 -0500
committermidipix <writeonce@midipix.org>2017-12-13 11:24:15 -0500
commit2111da6c6b5a906d2e9a821b3d6733684b7378eb (patch)
tree30819e5c135d015d09d3caf033fcce6ee04cde3a
parentf0d194ac855c0d447702c14440f9a5b8e28de38f (diff)
downloadperk-2111da6c6b5a906d2e9a821b3d6733684b7378eb.tar.bz2
perk-2111da6c6b5a906d2e9a821b3d6733684b7378eb.tar.xz
refactor: struct pe_meta_stats: members are now t-prefixed.
-rw-r--r--include/perk/perk.h6
-rw-r--r--src/info/pe_get_image_framework.c6
-rw-r--r--src/logic/pe_get_image_meta.c10
-rw-r--r--src/output/pe_output_import_libraries.c4
4 files changed, 13 insertions, 13 deletions
diff --git a/include/perk/perk.h b/include/perk/perk.h
index b51b641..d667413 100644
--- a/include/perk/perk.h
+++ b/include/perk/perk.h
@@ -77,9 +77,9 @@ struct pe_expsym {
};
struct pe_meta_stats {
- int32_t nexpsyms;
- int32_t nimplibs;
- int32_t nrelocs;
+ int32_t t_nexpsyms;
+ int32_t t_nimplibs;
+ int32_t t_nrelocs;
};
struct pe_image_meta {
diff --git a/src/info/pe_get_image_framework.c b/src/info/pe_get_image_framework.c
index 2a574fc..c570371 100644
--- a/src/info/pe_get_image_framework.c
+++ b/src/info/pe_get_image_framework.c
@@ -27,7 +27,7 @@ static const char * const pe_framework_str[PE_FRAMEWORK_CAP] = {
static bool pe_image_is_psxscl(const struct pe_image_meta * m)
{
- return (!m->m_stats.nimplibs
+ return (!m->m_stats.t_nimplibs
&& !pe_get_expsym_by_name(m,"__psx_init",0));
}
@@ -35,7 +35,7 @@ static bool pe_image_is_cygwin(const struct pe_image_meta * m)
{
int i;
- for (i=0; i<m->m_stats.nimplibs; i++)
+ for (i=0; i<m->m_stats.t_nimplibs; i++)
if (!(strcmp(m->m_idata[i].ih_name,"cygwin1.dll")))
return true;
@@ -46,7 +46,7 @@ static bool pe_image_is_msys(const struct pe_image_meta * m)
{
int i;
- for (i=0; i<m->m_stats.nimplibs; i++)
+ for (i=0; i<m->m_stats.t_nimplibs; i++)
if (!(strcmp(m->m_idata[i].ih_name,"msys-2.0.dll")))
return true;
diff --git a/src/logic/pe_get_image_meta.c b/src/logic/pe_get_image_meta.c
index 60b7086..f995b11 100644
--- a/src/logic/pe_get_image_meta.c
+++ b/src/logic/pe_get_image_meta.c
@@ -18,7 +18,7 @@ static int pe_free_image_meta_impl(struct pe_image_meta * meta, int ret)
int i;
if (meta) {
- for (i=0; i<meta->m_stats.nimplibs; i++)
+ for (i=0; i<meta->m_stats.t_nimplibs; i++)
free(meta->m_idata[i].ih_items);
free(meta->m_idata);
@@ -259,7 +259,7 @@ int pe_get_image_meta(
if (m->r_edata) {
pe_read_export_header(m->r_edata,&m->m_edata);
- m->m_stats.nexpsyms = m->m_edata.eh_num_of_name_ptrs;
+ m->m_stats.t_nexpsyms = m->m_edata.eh_num_of_name_ptrs;
}
/* .idata */
@@ -285,14 +285,14 @@ int pe_get_image_meta(
if (m->r_idata) {
/* num of implibs */
for (pidata=m->r_idata; pe_read_long(pidata->ih_name_rva); pidata++)
- m->m_stats.nimplibs++;
+ m->m_stats.t_nimplibs++;
/* import headers */
- if (!(m->m_idata = calloc(m->m_stats.nimplibs,sizeof(*m->m_idata))))
+ if (!(m->m_idata = calloc(m->m_stats.t_nimplibs,sizeof(*m->m_idata))))
return pe_free_image_meta_impl(
m,PERK_SYSTEM_ERROR(dctx));
- for (i=0; i<m->m_stats.nimplibs; i++) {
+ for (i=0; i<m->m_stats.t_nimplibs; i++) {
pe_read_import_header(&m->r_idata[i],&m->m_idata[i]);
m->m_idata[i].ih_name = base + m->h_idata->sh_ptr_to_raw_data
diff --git a/src/output/pe_output_import_libraries.c b/src/output/pe_output_import_libraries.c
index 745ab5b..a5c49bf 100644
--- a/src/output/pe_output_import_libraries.c
+++ b/src/output/pe_output_import_libraries.c
@@ -50,7 +50,7 @@ int pe_output_import_libraries(
unsigned j;
const struct pe_common_ctx * cctx = dctx->cctx;
- if (!m->m_stats.nimplibs)
+ if (!m->m_stats.t_nimplibs)
return 0;
if (!fout)
@@ -59,7 +59,7 @@ int pe_output_import_libraries(
if ((pretty_header(cctx,fout)) < 0)
return PERK_FILE_ERROR(dctx);
- for (i=0; i<m->m_stats.nimplibs; i++) {
+ for (i=0; i<m->m_stats.t_nimplibs; i++) {
if ((pretty_implib_header(cctx,m->m_idata[i].ih_name,fout)) < 0)
return PERK_FILE_ERROR(dctx);