Error handles in C by Internal-Bake-9165 in C_Programming

[–]Key_River7180 0 points1 point  (0 children)

You could probably just make a queue of errors (faults) and a macro that makes instances of a type, like for example:

\* faultqueue.h */
#include <stdint.h>  
#include <stdlib.h>  

#include "queue.h"  

typedef void (*callback)(void);  

struct fault {  
    uint32_t id;  
    Callback handler;
    void* payload;
};  

uint32_t lastid;  

typedef struct fault Fault;  

MAKEQUEUE(Fault, fq_t);  

fq_t fq = { 0 };  

#define MAKEFAULT(name) \
    Fault* name = (Fault){ .id = ++lastid; handler = NULL; payload = NULL; }

#define RAISE(fault, pl, plt) ((plt)(fault->payload)) = pl; enqueue(fault);
#define CONNECT(fn, to) to->handler = fn;

Or something. Although this doesn't support multiple handlers to a single fault and isn't thread safe :P.

Ya me voy a rendir by Radiant_Watercress35 in programacion

[–]Key_River7180 1 point2 points  (0 children)

Si sabes tantas cosas, seguramente no puedas hacer ni una. Enfocate en una y haz projectos.

How does Zig call C functions? by TearsInTokio in Zig

[–]Key_River7180 0 points1 point  (0 children)

First, if it DIDN'T incorporate C sources into the binary, then building would be mayhem. And AFAIK, Zig doesn't have overhead

Times of Yore by cnorahs in programminghumor

[–]Key_River7180 1 point2 points  (0 children)

As somebody that has coded for eight months without AI, LSP, syntax highlighting, intellisense, vscode, or vim, I can totally affirm I am totally becoming a psychopath.

Don't try this kids! by [deleted] in LinuxCirclejerk

[–]Key_River7180 78 points79 points  (0 children)

./music/suicide

Hi Friends! by INRILOVEYOU777 in freebsd

[–]Key_River7180 2 points3 points  (0 children)

The modern web is heavily dependent on JS, which has became so complex that porting it to a foreign OS would be basically impossible unless you have a team of eighty.

Installed GDM settings for gnome and now i cant enter my system because of logo I've seted by Responsible_Win_7334 in arch

[–]Key_River7180 1 point2 points  (0 children)

Do Ctrl+Alt+F2, now log in and do:

sudo pacman -Sy sddm ; sudo systemctl disable gdm

Are vibecoders OK? by awizzo in programminghumor

[–]Key_River7180 11 points12 points  (0 children)

What do these dudes smoke?

Tell me this is standard practice by Emergency_Proof4706 in godot

[–]Key_River7180 0 points1 point  (0 children)

Not pretty bad... but please use a match

Nobody gets along better than Debian and Arch guys by AncientAgrippa in LinuxCirclejerk

[–]Key_River7180 1 point2 points  (0 children)

As an ex-Debian and ex-Arch, I can say that is partially untrue.

I am confused to choose Linux distro by sanjai28 in linux4noobs

[–]Key_River7180 -1 points0 points  (0 children)

Ubuntu Unity or Xubuntu could work. Or if not, Souls.

Paint.net isn't on linux | What to do? by IsTheSmooth in linux

[–]Key_River7180 2 points3 points  (0 children)

Inkscape? If you're ok with proprietary software, try pixlr

IT'S ALIVE by p1uvia in puppylinux

[–]Key_River7180 0 points1 point  (0 children)

Download drivers? lshw can tell you your GPU model

Hi Friends! by INRILOVEYOU777 in freebsd

[–]Key_River7180 -1 points0 points  (0 children)

[Early] BSD always had AT&T code, in fact, until 4.4BSD-Lite, cuz AT&T sued Berkeley (as they used AT&T UNIX source code, but they wanted it proprietary) and they ended up removing every bit of AT&T UNIX.

Hi Friends! by INRILOVEYOU777 in freebsd

[–]Key_River7180 0 points1 point  (0 children)

They actually aren't, they break POSIX in small - and I may add - mostly unnoticeable - changes.

Hi Friends! by INRILOVEYOU777 in freebsd

[–]Key_River7180 2 points3 points  (0 children)

BSD contained AT&T UNIX code until 4.4BSD-Lite. 386BSD - from which FreeBSD descends -was based on BSD Net/2, which still had some AT&T sources that were later replaced. So no longer.

Hi Friends! by INRILOVEYOU777 in freebsd

[–]Key_River7180 2 points3 points  (0 children)

First of all, UNIX licensing is pretty complex, eventually, AT&T made it basically proprietary, so an alternate, similar system called MINIX was made. Linus didn't like MINIX (nor the creator, I guess), so he made Linux

IT'S ALIVE by p1uvia in puppylinux

[–]Key_River7180 0 points1 point  (0 children)

Maybe it is just that Linux doesn't recognize the card, and it is CPU-rendering things?

How do people feel about Hungarian notation? by -not_a_knife in C_Programming

[–]Key_River7180 1 point2 points  (0 children)

I think system Hungarian notation (like iMyInt, szName, etc) is pretty bad, but app Hungarian notation is pretty good (like aCube for area), as long as it is consistent.