Solve No Previous Prototype GCC warning

In some cases there were missing includes of own
header files from implementation files.

In other cases moved function which are only used
within single file into an anonymous namespace.

Change-Id: I2c6b411bcfbc521e2a5f21265dc8e009a548b1c8
diff --git a/internal/ceres/solver_impl.cc b/internal/ceres/solver_impl.cc
index 7f85fbe..5bcfdc6 100644
--- a/internal/ceres/solver_impl.cc
+++ b/internal/ceres/solver_impl.cc
@@ -1228,8 +1228,8 @@
 // Find the minimum index of any parameter block to the given residual.
 // Parameter blocks that have indices greater than num_eliminate_blocks are
 // considered to have an index equal to num_eliminate_blocks.
-int MinParameterBlock(const ResidualBlock* residual_block,
-                      int num_eliminate_blocks) {
+static int MinParameterBlock(const ResidualBlock* residual_block,
+                             int num_eliminate_blocks) {
   int min_parameter_block_position = num_eliminate_blocks;
   for (int i = 0; i < residual_block->NumParameterBlocks(); ++i) {
     ParameterBlock* parameter_block = residual_block->parameter_blocks()[i];