[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] tips-and-tricks.org: Update
From: |
Jose E. Marchesi |
Subject: |
Re: [PATCH] tips-and-tricks.org: Update |
Date: |
Mon, 31 Jan 2022 19:11:07 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Hi Mohammad.
There is no need to ask for patch approval when it comes to update
pokology; the only requirement is to have write access.
> ---
> tips-and-tricks.org | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
>
> Hi, Jose.
>
> apache2 sent this patch for pokology. I'm sending it to your for review.
>
>
> Thanks!
>
> diff --git a/tips-and-tricks.org b/tips-and-tricks.org
> index eab6924..5ca187d 100644
> --- a/tips-and-tricks.org
> +++ b/tips-and-tricks.org
> @@ -80,6 +80,22 @@
> : (poke) (BER_Variable_Contents @ 0#B).get_bytes
> : [0x61UB,0x62UB,0x63UB,0x64UB,0x65UB]
>
> + Similar results can be achieved using the idiom of resolving the
> + element count using a function:
> +
> + : type VC = struct
> + : {
> + : fun poff = (offset<int,1> x)offset<int,1>:
> + : {
> + : while((byte[2] @ 0 : x) != [0UB, 0UB]){ x+=1#B; }
> + : return x - 1#B;
> + : }
> + : byte[ poff(OFFSET) ] payload;
> + : byte[2] end == [0UB,0UB];
> + : };
> + : (poke) VC @ #b;
> + : VC {payload=[0x61UB,0x62UB,0x63UB,0x64UB,0x65UB],end=[0x0UB,0x0UB]}
> +
> * Sub-byte endianness swaps
>
> Byte-endianness is typically handled quite transparently in poke by