From: Indu Bhagat <indu.bhagat@oracle.com>
To: binutils@sourceware.org
Cc: Indu Bhagat <indu.bhagat@oracle.com>
Subject: [COMMITTED 5/6] libsframe: use consistent function argument names
Date: Wed, 19 Apr 2023 15:11:24 -0700 [thread overview]
Message-ID: <20230419221125.502883-6-indu.bhagat@oracle.com> (raw)
In-Reply-To: <20230419221125.502883-1-indu.bhagat@oracle.com>
libsframe/
* sframe.c (sframe_decoder_get_header): Use consistent function
arg names.
(sframe_decoder_free): Likewise.
(sframe_encode): Use more appropriate var name.
---
libsframe/sframe.c | 28 ++++++++++++++--------------
1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/libsframe/sframe.c b/libsframe/sframe.c
index b2c8eacae14..0b47e264ab1 100644
--- a/libsframe/sframe.c
+++ b/libsframe/sframe.c
@@ -469,14 +469,14 @@ bad:
/* The SFrame Decoder. */
-/* Get DECODER's SFrame header. */
+/* Get SFrame header from the given decoder context DCTX. */
static sframe_header *
-sframe_decoder_get_header (sframe_decoder_ctx *decoder)
+sframe_decoder_get_header (sframe_decoder_ctx *dctx)
{
sframe_header *hp = NULL;
- if (decoder != NULL)
- hp = &decoder->sfd_header;
+ if (dctx != NULL)
+ hp = &dctx->sfd_header;
return hp;
}
@@ -534,11 +534,11 @@ sframe_get_fre_offset (sframe_frame_row_entry *fre, int idx, int *errp)
/* Free the decoder context. */
void
-sframe_decoder_free (sframe_decoder_ctx **decoder)
+sframe_decoder_free (sframe_decoder_ctx **dctxp)
{
- if (decoder != NULL)
+ if (dctxp != NULL)
{
- sframe_decoder_ctx *dctx = *decoder;
+ sframe_decoder_ctx *dctx = *dctxp;
if (dctx == NULL)
return;
@@ -558,8 +558,8 @@ sframe_decoder_free (sframe_decoder_ctx **decoder)
dctx->sfd_buf = NULL;
}
- free (*decoder);
- *decoder = NULL;
+ free (*dctxp);
+ *dctxp = NULL;
}
}
@@ -1221,18 +1221,18 @@ sframe_encode (unsigned char ver, unsigned char flags, int abi_arch,
int8_t fixed_fp_offset, int8_t fixed_ra_offset, int *errp)
{
sframe_header *hp;
- sframe_encoder_ctx *fp;
+ sframe_encoder_ctx *encoder;
if (ver != SFRAME_VERSION)
return sframe_ret_set_errno (errp, SFRAME_ERR_VERSION_INVAL);
- if ((fp = malloc (sizeof (sframe_encoder_ctx))) == NULL)
+ if ((encoder = malloc (sizeof (sframe_encoder_ctx))) == NULL)
return sframe_ret_set_errno (errp, SFRAME_ERR_NOMEM);
- memset (fp, 0, sizeof (sframe_encoder_ctx));
+ memset (encoder, 0, sizeof (sframe_encoder_ctx));
/* Get the SFrame header and update it. */
- hp = sframe_encoder_get_header (fp);
+ hp = sframe_encoder_get_header (encoder);
hp->sfh_preamble.sfp_version = ver;
hp->sfh_preamble.sfp_magic = SFRAME_MAGIC;
hp->sfh_preamble.sfp_flags = flags;
@@ -1241,7 +1241,7 @@ sframe_encode (unsigned char ver, unsigned char flags, int abi_arch,
hp->sfh_cfa_fixed_fp_offset = fixed_fp_offset;
hp->sfh_cfa_fixed_ra_offset = fixed_ra_offset;
- return fp;
+ return encoder;
}
/* Free the encoder context. */
--
2.39.2
next prev parent reply other threads:[~2023-04-19 22:11 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-19 22:11 [COMMITTED 0/6] Minor sframe related patches Indu Bhagat
2023-04-19 22:11 ` [COMMITTED 1/6] gas: sframe: use ATTRIBUTE_UNUSED consistently Indu Bhagat
2023-04-19 22:11 ` [COMMITTED 2/6] gas: sframe: fix comment Indu Bhagat
2023-04-19 22:11 ` [COMMITTED 3/6] libsframe: use return type of bool for predicate functions Indu Bhagat
2023-04-19 22:11 ` [COMMITTED 4/6] sframe: correct some typos Indu Bhagat
2023-04-19 22:11 ` Indu Bhagat [this message]
2023-04-19 22:11 ` [COMMITTED 6/6] libsframe: minor formatting fixes in sframe_encoder_write_fre Indu Bhagat
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230419221125.502883-6-indu.bhagat@oracle.com \
--to=indu.bhagat@oracle.com \
--cc=binutils@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).