The expression passed to %assign is a critical expression (see section 3.8), and must also evaluate to a pure number (rather than a relocatable reference such as a code or data address, or anything involving a register)
#include <stdio.h>
#include <string.h>
int main() {
char buf[] = {90, 12, 89, 0, 11};
size_t idx = memchr(buf, 11, sizeof(buf)) - (void*)buf;
printf("Index of 11 is %lu\n", idx);
idx = memchr(buf, 0, sizeof(buf)) - (void*)buf;
printf("Index of 0 is %lu\n", idx);
}
inoremap <D-v>
void decrypt(char *str, size_t len) {
for(size_t i = 0; i < len; i += 2) {
uint16_t state = *(uint16_t*)&str[i];
for (size_t r = 0; r < 34567890; r++) {
state *= 26399;
state += 11258;
state *= 24743;
state ^= 17548;
state *= 60521;
state -= 14122;
state *= 47951;
state += 16196;
state *= 21685;
state ^= 27569;
}
*(uint16_t*)&str[i] = state;
}
}
color_t c = *(0x0264FEF8 + i*sizeof(color_t));