[vlc-commits] [Git][videolan/vlc][master] 5 commits: access/http: add restrict to window_status

Steve Lhomme (@robUx4) gitlab at videolan.org
Mon Jan 30 10:24:07 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
5b299301 by Steve Lhomme at 2023-01-30T10:06:19+00:00
access/http: add restrict to window_status

This matches the use of restrict in vlc_h2_window_status from h2conn.c

- - - - -
0bc1624e by Steve Lhomme at 2023-01-30T10:06:19+00:00
access/http: match the restrict usage of callbacks

The callbacks set in cb have a few restrict keywords set in their parameters.

- - - - -
0b2856a3 by Steve Lhomme at 2023-01-30T10:06:19+00:00
access: fix restrict usage in block reading callbacks

- - - - -
7fd7db93 by Steve Lhomme at 2023-01-30T10:06:19+00:00
amem: fix restrict usage in start callback

To match the callback in audio_output.

- - - - -
a45ecc83 by Steve Lhomme at 2023-01-30T10:06:19+00:00
rtp-rawvid: fix callback declaration to match restrict keywords

As used by all the vlc_rtp_video_raw_cb callbacks.

- - - - -


10 changed files:

- modules/access/amt.c
- modules/access/dtv/access.c
- modules/access/http/h2frame.h
- modules/access/http/h2frame_test.c
- modules/access/http/hpack.c
- modules/access/imem.c
- modules/access/vcd/vcd.c
- modules/audio_output/amem.c
- modules/codec/rtp-rawvid.c
- src/input/stream_extractor.c


Changes:

=====================================
modules/access/amt.c
=====================================
@@ -357,7 +357,7 @@ vlc_module_end ()
 /*****************************************************************************
  * Local prototypes
  *****************************************************************************/
-static block_t *BlockAMT( stream_t *, bool * );
+static block_t *BlockAMT( stream_t *, bool * restrict );
 static int Control( stream_t *, int, va_list );
 
 /*****************************************************************************


=====================================
modules/access/dtv/access.c
=====================================
@@ -430,7 +430,7 @@ typedef struct
     tuner_setup_t pf_setup;
 } access_sys_t;
 
-static block_t *Read (stream_t *, bool *);
+static block_t *Read (stream_t *, bool * restrict);
 static int Control (stream_t *, int, va_list);
 static dtv_delivery_t GuessSystem (const char *, dvb_device_t *);
 static dtv_delivery_t GetDeliveryByScheme(const char *psz_scheme);


=====================================
modules/access/http/h2frame.h
=====================================
@@ -106,7 +106,7 @@ struct vlc_h2_parser_cbs
     int  (*ping)(void *ctx, uint_fast64_t opaque);
     void (*error)(void *ctx, uint_fast32_t code);
     int  (*reset)(void *ctx, uint_fast32_t last_seq, uint_fast32_t code);
-    void (*window_status)(void *ctx, uint32_t *rcwd);
+    void (*window_status)(void *ctx, uint32_t * restrict rcwd);
     void (*window_update)(void *ctx, uint_fast32_t credit);
 
     void *(*stream_lookup)(void *ctx, uint_fast32_t id);


=====================================
modules/access/http/h2frame_test.c
=====================================
@@ -122,7 +122,7 @@ static int vlc_h2_reset(void *ctx, uint_fast32_t last_seq, uint_fast32_t code)
     return 0;
 }
 
-static void vlc_h2_window_status(void *ctx, uint32_t *rcwd)
+static void vlc_h2_window_status(void *ctx, uint32_t * restrict rcwd)
 {
     assert(ctx == CTX);
     *rcwd = (1u << 31) - 1;


=====================================
modules/access/http/hpack.c
=====================================
@@ -552,8 +552,8 @@ static int hpack_decode_hdr(struct hpack_decoder *dec,
                             char **restrict namep,
                             char **restrict valuep)
 {
-    int (*cb)(struct hpack_decoder *, const uint8_t **, size_t *,
-              char **, char **);
+    int (*cb)(struct hpack_decoder *, const uint8_t ** restrict, size_t * restrict,
+              char ** restrict, char ** restrict);
 
     assert(*lengthp >= 1);
 


=====================================
modules/access/imem.c
=====================================
@@ -198,7 +198,7 @@ typedef void (*imem_release_t)(void *data, const char *cookie, size_t, void *);
  *****************************************************************************/
 
 /* */
-static block_t *Block(stream_t *, bool *);
+static block_t *Block(stream_t *, bool * restrict);
 static int ControlAccess(stream_t *, int, va_list);
 
 static int Demux(demux_t *);


=====================================
modules/access/vcd/vcd.c
=====================================
@@ -81,7 +81,7 @@ typedef struct
     int         i_sector;                                  /* Current Sector */
 } access_sys_t;
 
-static block_t *Block( stream_t *, bool * );
+static block_t *Block( stream_t *, bool * restrict);
 static int      Seek( stream_t *, uint64_t );
 static int      Control( stream_t *, int, va_list );
 static int      EntryPoints( stream_t * );


=====================================
modules/audio_output/amem.c
=====================================
@@ -213,7 +213,7 @@ static void Stop (audio_output_t *aout)
     vlc_mutex_unlock(&sys->lock);
 }
 
-static int Start (audio_output_t *aout, audio_sample_format_t *fmt)
+static int Start (audio_output_t *aout, audio_sample_format_t * restrict fmt)
 {
     aout_sys_t *sys = aout->sys;
     char format[5] = "S16N";


=====================================
modules/codec/rtp-rawvid.c
=====================================
@@ -545,8 +545,8 @@ static void decode_yuv411_8(void *restrict *restrict planes,
     }
 }
 
-typedef void (*vlc_rtp_video_raw_cb)(void *restrict *,
-                                     const unsigned char *, size_t);
+typedef void (*vlc_rtp_video_raw_cb)(void *restrict * restrict,
+                                     const unsigned char * restrict, size_t);
 
 struct vlc_rtp_video_raw_dec {
     unsigned int pgroup;


=====================================
src/input/stream_extractor.c
=====================================
@@ -151,7 +151,7 @@ se_StreamRead( stream_t* stream, void* buf, size_t len )
 }
 
 static block_t*
-se_StreamBlock( stream_t* stream, bool* eof )
+se_StreamBlock( stream_t* stream, bool* restrict eof )
 {
     struct stream_extractor_private* priv = stream->p_sys;
     return priv->extractor.pf_block( &priv->extractor, eof );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/26cabd5a5f84df770452e0b267056c7fe5504e7e...a45ecc83f04a570a700a5a689a01c1a3602e6fc4

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/26cabd5a5f84df770452e0b267056c7fe5504e7e...a45ecc83f04a570a700a5a689a01c1a3602e6fc4
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list