cheatsheet: Clean up trailing whitespace

This commit is contained in:
Léo Lam 2021-09-09 22:34:25 +02:00
parent 65e671d74c
commit 934ee7b096
No known key found for this signature in database
GPG Key ID: 0DF30F9081000741
1 changed files with 8 additions and 8 deletions

View File

@ -39,7 +39,7 @@ The following actions should help when basic blocks are in the wrong order, or w
## sinit / static initializer / cxa_atexit ## sinit / static initializer / cxa_atexit
* If the second argument of a `_cxa_atexit` call is nullptr and the destructor is a nullsub, the object in question is likely a C-style array (not a std::array or a sead::SafeArray). * If the second argument of a `_cxa_atexit` call is nullptr and the destructor is a nullsub, the object in question is likely a C-style array (not a std::array or a sead::SafeArray).
## Inline functions ## Inline functions
@ -79,7 +79,7 @@ x._.vptr = &`vtable for'sead::BufferedSafeStringBase<char>;
x.length = N; // where N is a number x.length = N; // where N is a number
sead::BufferedSafeStringBase<char>::assureTerminationImpl_(&x); sead::BufferedSafeStringBase<char>::assureTerminationImpl_(&x);
*x._.cstr = sead::SafeStringBase<char>::cNullChar; *x._.cstr = sead::SafeStringBase<char>::cNullChar;
x._.vptr = ...; x._.vptr = ...;
``` ```
⬇️ ⬇️
```cpp ```cpp
@ -316,10 +316,10 @@ if ( v15 )
{ {
*(_QWORD *)v15 = (signed int)num_tables; *(_QWORD *)v15 = (signed int)num_tables;
v16 = (BdropTable *)((char*)v15 + 8); v16 = (BdropTable *)((char*)v15 + 8);
// loop over each item and call a constructor // loop over each item and call a constructor
// note: the constructor may be inlined // note: the constructor may be inlined
// at the end: // at the end:
buffer->size = num_tables; buffer->size = num_tables;
buffer->data = v16; buffer->data = v16;
@ -339,7 +339,7 @@ if ( v13 )
*v13 = count; *v13 = count;
v14 = (signed __int64)(v13 + 1); v14 = (signed __int64)(v13 + 1);
// loop over each item and call a constructor // loop over each item and call a constructor
// note: the constructor may be inlined // note: the constructor may be inlined
// at the end: // at the end:
*buffer = count; *buffer = count;
*((_QWORD *)buffer + 1) = v14; *((_QWORD *)buffer + 1) = v14;
@ -364,7 +364,7 @@ else
``` ```
⬇️ ⬇️
```cpp ```cpp
item = buffer[i]; item = buffer[i];
``` ```
--- ---
@ -544,7 +544,7 @@ SomeClass::SomeClass(ptr); //< constructor call
``` ```
⬇️ ⬇️
```cpp ```cpp
auto* ptr = new (heap) SomeClass; auto* ptr = new (heap) SomeClass;
``` ```
Sometimes, a non-throwing overload of `operator new` is used: Sometimes, a non-throwing overload of `operator new` is used:
@ -555,7 +555,7 @@ SomeClass::SomeClass(ptr); //< constructor call
``` ```
⬇️ ⬇️
```cpp ```cpp
auto* ptr = new (heap, std::nothrow) SomeClass; auto* ptr = new (heap, std::nothrow) SomeClass;
``` ```
This also applies for `new[]`. This also applies for `new[]`.