Remve an assignment that isn't refererenced.  Found with clang.
Removed an assignment that was duplicated in the line above it.
Remove some vars that were not referenced.  Found with clang.
Removed redundant code, again found by clang.
Removed assignment that wasn't referenced, found by clang.
Removed another unused reference found by clang.
Fix possible divide by zero found with clang.
Removed a bunch of dead assignments again thanks to clang.
Removed another dead assignment thanks to clang.

If look look at the loop, at line 1805 elts is set and its
only used in this case statement, so it's overwritten there before
being used.
Merge ../gurbalib/src/dgd