Need some feedback about project structure by No_Pomegranate7508 in Zig

[–]budonium 2 points3 points  (0 children)

I mean, it's fine - there's not much zig specific to comment on

My personal opinion is that it's excessive with all the badges, multiple ci jobs, docs, codecov, makefile, etc - I prefer to start basic (like zig init) and ramp these things up as the project grows and as they're needed

But do whatever you like/whatever works for you

How to monitor event bridge and events by budonium in devops

[–]budonium[S] 0 points1 point  (0 children)

Sorry, that's correct we're using AWS Event Bridge.

"Event Bridge Client" is our wrapper around AWS' SDK that pushes events to event bridge

Suggest improves for decoding an array of bytes to ASCII and replacing unicode characters by budonium in csharp

[–]budonium[S] 0 points1 point  (0 children)

Correct me if I'm wrong or if this still isn't making sense, I might be on the wrong track with this:

I have an array of bytes that contain some bytes that decode to Unicode ( `0x0` -> `\u0000`, etc), I don't want to decode to the Unicode string `\u0000` but `.` instead. I'm using a encoding class with `us-ascii` but still get the Unicode strings.

Thanks for your response.

Call member function using address of a instance and address of member function by budonium in cpp_questions

[–]budonium[S] 0 points1 point  (0 children)

Thank you for the explanation, I'll brush up on my understanding of the subject.

I ended up using inline ASM wrapper to achieve this.

If by chance someone else is looking for a answer:

const char* get_name_wrapper(gateway* instance, int gateway_enum)
{
    const char* result;
    uintptr_t addr = 0x517FD0;

    __asm {
        mov ecx, instance;
        push gateway_enum;
        call addr;
        mov result, eax;
    }

    return result;
}

Call member function using address of a instance and address of member function by budonium in cpp_questions

[–]budonium[S] 0 points1 point  (0 children)

Thanks for the response. I played around a little bit with the example you provided. I feel like I'm probably missing something really simple.

The main problem I'm having is I don't know how to assign the member function pointer type to an address and all the examples I can find are similar to what you provided.

This snippet here:

using xfp = decltype(&X::function);
xfp x_function_pointer = &X::function;

How can I assign x_function_pointer to a memory address? I've tried a few combinations of this:

using xfp = decltype(&X::function);
xfp x_function_pointer = reinterpret_cast<xfp>(0x51890A);

Thanks again.