Change the type of num_scan_hits from signed to unsigned.

To avoid VC++ warning C4018.
Remove unused variables.

To avoid VC++ warning C4101.
Remove const specifiers and remove array members from initializer lists.

To avoid VC++ warning C4351.