hasherezade / libpeconv

A library to load, manipulate, dump PE files. See also: https://github.com/hasherezade/libpeconv_tpl
https://hasherezade.github.io/libpeconv
BSD 2-Clause "Simplified" License
1.09k stars 177 forks source link

fix const correctness #41

Closed maximegmd closed 2 years ago

hasherezade commented 2 years ago

ok, we can change LPWSTR to LPCWSTR, but what is the benefit of changing a pointer to WCHAR into autopointer?

auto *curr_end_ptr = curr_name;

changed from:

WCHAR *curr_end_ptr = curr_name;

I prefer using explicit variable types - using autopointers (unless it is really needed) just unnecessarily obfuscates the code. also in:


HMODULE peconv::get_module_via_peb(IN OPTIONAL LPCWSTR const module_name)

You wrote: LPCWSTR const - why again const after LPCWSTR? Also in the definition of the same function you wrote without this additional const:

HMODULE get_module_via_peb(IN OPTIONAL LPCWSTR module_name = nullptr);
maximegmd commented 2 years ago

There you go, I have addressed the issues!