Last active
March 5, 2024 08:45
-
-
Save damurashov/134566c21a9741714b97be71b8fcc82b to your computer and use it in GitHub Desktop.
`std::size_t` GTFO
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| import sys | |
| def main(): | |
| filename = sys.argv[1] | |
| print('got filename', filename) | |
| with open(filename, 'r') as f: | |
| content = f.read() | |
| content = content.replace('cstddef', 'stddef.h') | |
| content = content.replace('cstdint', 'stdint.h') | |
| content = content.replace('std::size', 'size') | |
| content = content.replace('std::int', 'int') | |
| content = content.replace('std::uint', 'uint') | |
| with open(filename, 'w') as f: | |
| f.write(content) | |
| if __name__ == "__main__": | |
| main() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| find . -type f -name '*pp' | grep -v 'Libs/' | grep -v 'build_nuttx' | grep -vi 'lua' | xargs -n 1 realpath > /tmp/files.txt | |
| cat /tmp/files.txt | xargs -n 1 oo-replace-sizet.py |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment