Thread: Re: What is the story behind _SPI_PLAN_MAGIC?

Re: What is the story behind _SPI_PLAN_MAGIC?

From
Tom Lane
Date:
Marcelo Fernandes <marcefern7@gmail.com> writes:
> Reading through the SPI code I see this definition:
>   #define _SPI_PLAN_MAGIC 569278163
> What is its purpose?

Just to catch programming errors, ie passing the wrong pointer
value to some SPI function.  See the checks for it in spi.c.

            regards, tom lane



Re: What is the story behind _SPI_PLAN_MAGIC?

From
Marcelo Fernandes
Date:
On Mon, Feb 3, 2025 at 3:17 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Just to catch programming errors, ie passing the wrong pointer
> value to some SPI function.  See the checks for it in spi.c.

Aha! Perfect, I thought it was something like that. Thank you!
Marcelo.