Fix inconsistent pointer-integer conversion.

Found during chromium integration.
Fix necessary function declarations to make it to individually compile sources.

Found during chromium integration.