[x264-devel] commit: Mark cli_input/output_t variables as const when possible ( Alexander Strange )

git version control git at videolan.org
Mon Feb 15 10:07:48 CET 2010


x264 | branch: master | Alexander Strange <astrange at ithinksw.com> | Sat Feb 13 02:22:04 2010 -0500| [dcef20c00f1248beb7a6a55448976be6cbd3ee5b] | committer: Jason Garrett-Glaser 

Mark cli_input/output_t variables as const when possible

> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=dcef20c00f1248beb7a6a55448976be6cbd3ee5b
---

 input/avs.c       |    2 +-
 input/ffms.c      |    2 +-
 input/input.h     |   10 +++++-----
 input/lavf.c      |    2 +-
 input/y4m.c       |    2 +-
 input/yuv.c       |    2 +-
 output/flv.c      |    2 +-
 output/matroska.c |    2 +-
 output/mp4.c      |    2 +-
 output/output.h   |    8 ++++----
 output/raw.c      |    2 +-
 11 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/input/avs.c b/input/avs.c
index 522f8fe..79b5c80 100644
--- a/input/avs.c
+++ b/input/avs.c
@@ -313,4 +313,4 @@ static int close_file( hnd_t handle )
     return 0;
 }
 
-cli_input_t avs_input = { open_file, get_frame_total, picture_alloc, read_frame, release_frame, picture_clean, close_file };
+const cli_input_t avs_input = { open_file, get_frame_total, picture_alloc, read_frame, release_frame, picture_clean, close_file };
diff --git a/input/ffms.c b/input/ffms.c
index b680967..14962c7 100644
--- a/input/ffms.c
+++ b/input/ffms.c
@@ -244,4 +244,4 @@ static int close_file( hnd_t handle )
     return 0;
 }
 
-cli_input_t ffms_input = { open_file, get_frame_total, x264_picture_alloc, read_frame, NULL, x264_picture_clean, close_file };
+const cli_input_t ffms_input = { open_file, get_frame_total, x264_picture_alloc, read_frame, NULL, x264_picture_clean, close_file };
diff --git a/input/input.h b/input/input.h
index 9fb425c..6e386f4 100644
--- a/input/input.h
+++ b/input/input.h
@@ -60,11 +60,11 @@ typedef struct
     int (*close_file)( hnd_t handle );
 } cli_input_t;
 
-extern cli_input_t yuv_input;
-extern cli_input_t y4m_input;
-extern cli_input_t avs_input;
+extern const cli_input_t yuv_input;
+extern const cli_input_t y4m_input;
+extern const cli_input_t avs_input;
 extern cli_input_t thread_input;
-extern cli_input_t lavf_input;
-extern cli_input_t ffms_input;
+extern const cli_input_t lavf_input;
+extern const cli_input_t ffms_input;
 
 #endif
diff --git a/input/lavf.c b/input/lavf.c
index 180e509..6ecc6b0 100644
--- a/input/lavf.c
+++ b/input/lavf.c
@@ -269,4 +269,4 @@ static int close_file( hnd_t handle )
     return 0;
 }
 
-cli_input_t lavf_input = { open_file, get_frame_total, picture_alloc, read_frame, NULL, picture_clean, close_file };
+const cli_input_t lavf_input = { open_file, get_frame_total, picture_alloc, read_frame, NULL, picture_clean, close_file };
diff --git a/input/y4m.c b/input/y4m.c
index 1619f74..8645ff7 100644
--- a/input/y4m.c
+++ b/input/y4m.c
@@ -242,4 +242,4 @@ static int close_file( hnd_t handle )
     return 0;
 }
 
-cli_input_t y4m_input = { open_file, get_frame_total, x264_picture_alloc, read_frame, NULL, x264_picture_clean, close_file };
+const cli_input_t y4m_input = { open_file, get_frame_total, x264_picture_alloc, read_frame, NULL, x264_picture_clean, close_file };
diff --git a/input/yuv.c b/input/yuv.c
index dbd0317..3e39e07 100644
--- a/input/yuv.c
+++ b/input/yuv.c
@@ -125,4 +125,4 @@ static int close_file( hnd_t handle )
     return 0;
 }
 
-cli_input_t yuv_input = { open_file, get_frame_total, x264_picture_alloc, read_frame, NULL, x264_picture_clean, close_file };
+const cli_input_t yuv_input = { open_file, get_frame_total, x264_picture_alloc, read_frame, NULL, x264_picture_clean, close_file };
diff --git a/output/flv.c b/output/flv.c
index b3e5d16..2e0a0e4 100644
--- a/output/flv.c
+++ b/output/flv.c
@@ -305,4 +305,4 @@ static int close_file( hnd_t handle, int64_t largest_pts, int64_t second_largest
     return 0;
 }
 
-cli_output_t flv_output = { open_file, set_param, write_headers, write_frame, close_file };
+const cli_output_t flv_output = { open_file, set_param, write_headers, write_frame, close_file };
diff --git a/output/matroska.c b/output/matroska.c
index b1805e4..fb39ced 100644
--- a/output/matroska.c
+++ b/output/matroska.c
@@ -206,4 +206,4 @@ static int close_file( hnd_t handle, int64_t largest_pts, int64_t second_largest
     return ret;
 }
 
-cli_output_t mkv_output = { open_file, set_param, write_headers, write_frame, close_file };
+const cli_output_t mkv_output = { open_file, set_param, write_headers, write_frame, close_file };
diff --git a/output/mp4.c b/output/mp4.c
index b817c82..b99eaed 100644
--- a/output/mp4.c
+++ b/output/mp4.c
@@ -298,4 +298,4 @@ static int write_frame( hnd_t handle, uint8_t *p_nalu, int i_size, x264_picture_
     return i_size;
 }
 
-cli_output_t mp4_output = { open_file, set_param, write_headers, write_frame, close_file };
+const cli_output_t mp4_output = { open_file, set_param, write_headers, write_frame, close_file };
diff --git a/output/output.h b/output/output.h
index 851b819..c79b48e 100644
--- a/output/output.h
+++ b/output/output.h
@@ -33,9 +33,9 @@ typedef struct
     int (*close_file)( hnd_t handle, int64_t largest_pts, int64_t second_largest_pts );
 } cli_output_t;
 
-extern cli_output_t raw_output;
-extern cli_output_t mkv_output;
-extern cli_output_t mp4_output;
-extern cli_output_t flv_output;
+extern const cli_output_t raw_output;
+extern const cli_output_t mkv_output;
+extern const cli_output_t mp4_output;
+extern const cli_output_t flv_output;
 
 #endif
diff --git a/output/raw.c b/output/raw.c
index a4d1175..02e4c56 100644
--- a/output/raw.c
+++ b/output/raw.c
@@ -62,5 +62,5 @@ static int close_file( hnd_t handle, int64_t largest_pts, int64_t second_largest
     return fclose( (FILE*)handle );
 }
 
-cli_output_t raw_output = { open_file, set_param, write_headers, write_frame, close_file };
+const cli_output_t raw_output = { open_file, set_param, write_headers, write_frame, close_file };
 



More information about the x264-devel mailing list