diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:13:53 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:22 +0100 |
commit | 72c48b716640c76f0a8fa49341ce3b0099004991 (patch) | |
tree | 6aa8da1631e3d18272bd39ab55111885ab339b45 /desktop/unx | |
parent | 89c4edc13f203db1641c63e22774262bbe61f36f (diff) |
loplugin:nullptr (automatic rewrite)
Change-Id: I8204a300c98b891a842ef2e40b65f0810dd7817a
Diffstat (limited to 'desktop/unx')
-rw-r--r-- | desktop/unx/source/file_image.h | 2 | ||||
-rw-r--r-- | desktop/unx/source/file_image_unx.c | 12 | ||||
-rw-r--r-- | desktop/unx/source/pagein.c | 6 | ||||
-rw-r--r-- | desktop/unx/source/splashx.c | 4 | ||||
-rw-r--r-- | desktop/unx/source/start.c | 12 |
5 files changed, 18 insertions, 18 deletions
diff --git a/desktop/unx/source/file_image.h b/desktop/unx/source/file_image.h index 736ef57c0810..60fdc8e96a16 100644 --- a/desktop/unx/source/file_image.h +++ b/desktop/unx/source/file_image.h @@ -39,7 +39,7 @@ struct file_image_st typedef struct file_image_st file_image; -#define FILE_IMAGE_INITIALIZER { 0, 0 } +#define FILE_IMAGE_INITIALIZER { NULL, 0 } /** file_image_open. diff --git a/desktop/unx/source/file_image_unx.c b/desktop/unx/source/file_image_unx.c index fb677781cf65..c73e30b5134d 100644 --- a/desktop/unx/source/file_image_unx.c +++ b/desktop/unx/source/file_image_unx.c @@ -39,7 +39,7 @@ int file_image_open (file_image * image, const char * filename) struct stat st; void * p; - if (image == 0) + if (image == NULL) return EINVAL; image->m_base = MAP_FAILED, image->m_size = 0; @@ -53,7 +53,7 @@ int file_image_open (file_image * image, const char * filename) goto cleanup_and_leave; } - p = mmap (0, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); + p = mmap (NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); if (p == MAP_FAILED) { result = errno; @@ -78,10 +78,10 @@ int file_image_pagein (file_image * image) // force touching of each page despite the optimizer volatile char c =0; - if (image == 0) + if (image == NULL) return EINVAL; - if ((w.m_base = image->m_base) == 0) + if ((w.m_base = image->m_base) == NULL) return EINVAL; if ((w.m_size = image->m_size) == 0) return 0; @@ -112,13 +112,13 @@ int file_image_pagein (file_image * image) */ int file_image_close (file_image * image) { - if (image == 0) + if (image == NULL) return EINVAL; if (munmap (image->m_base, image->m_size) == -1) return errno; - image->m_base = 0, image->m_size = 0; + image->m_base = NULL, image->m_size = 0; return 0; } diff --git a/desktop/unx/source/pagein.c b/desktop/unx/source/pagein.c index 67ca3670d5f4..7db52d83c1d6 100644 --- a/desktop/unx/source/pagein.c +++ b/desktop/unx/source/pagein.c @@ -46,7 +46,7 @@ void pagein_execute(char const * path, char const * file) { char fullpath[4096]; char *p = NULL; - FILE * fp = 0; + FILE * fp = NULL; memset(fullpath, 0, sizeof(fullpath)); strncpy (fullpath, path, 3000); if (!(p = strrchr (fullpath, '/'))) @@ -55,13 +55,13 @@ void pagein_execute(char const * path, char const * file) p++; strncpy(p, file, 1024); p[strlen(p)] = '\0'; - if ((fp = fopen (fullpath, "r")) == 0) + if ((fp = fopen (fullpath, "r")) == NULL) { fprintf (stderr, "fopen %s: %s\n", fullpath, strerror(errno)); return; } - while (fgets (p, 1024, fp) != 0) + while (fgets (p, 1024, fp) != NULL) { p[strlen(p) - 1] = '\0'; diff --git a/desktop/unx/source/splashx.c b/desktop/unx/source/splashx.c index ce57afe85391..e26c5302f823 100644 --- a/desktop/unx/source/splashx.c +++ b/desktop/unx/source/splashx.c @@ -90,7 +90,7 @@ static int splash_load_bmp( struct splash* splash, const char *filename ) if ( !(file = fopen( filename, "r" ) ) ) return 0; - splash->png_ptr = png_create_read_struct( PNG_LIBPNG_VER_STRING, 0, 0, 0 ); + splash->png_ptr = png_create_read_struct( PNG_LIBPNG_VER_STRING, NULL, NULL, NULL ); splash->info_ptr = png_create_info_struct(splash->png_ptr); png_init_io( splash->png_ptr, file ); @@ -491,7 +491,7 @@ static int splash_create_window( struct splash* splash, int argc, char** argv ) size_hints.max_height = splash->height; XSetStandardProperties( splash->display, splash->win, name, icon, None, - 0, 0, &size_hints ); + NULL, 0, &size_hints ); // the actual work suppress_decorations(splash); diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c index 8803909adebf..525fe22927e0 100644 --- a/desktop/unx/source/start.c +++ b/desktop/unx/source/start.c @@ -256,7 +256,7 @@ get_md5hash( rtl_uString *pText ) return NULL; digest = rtl_digest_create( rtl_Digest_AlgorithmMD5 ); - if ( digest == 0 ) + if ( digest == NULL ) return NULL; md5_key_len = rtl_digest_queryLength( digest ); @@ -654,7 +654,7 @@ exec_javaldx (Args *args) rtl_uString *pTmp, *pTmp2; oslProcess javaldx = NULL; - oslFileHandle fileOut= 0; + oslFileHandle fileOut= NULL; oslProcessError err; ppArgs = (rtl_uString **)calloc( args->nArgsEnv + 2, sizeof( rtl_uString* ) ); @@ -739,7 +739,7 @@ exec_javaldx (Args *args) #endif // has to be a global :( -oslProcess * volatile g_pProcess = 0; +oslProcess * volatile g_pProcess = NULL; void sigterm_handler(int ignored) { @@ -768,11 +768,11 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv ) memset(&sigpipe_action, 0, sizeof(struct sigaction)); sigpipe_action.sa_handler = SIG_IGN; sigemptyset(&sigpipe_action.sa_mask); - sigaction(SIGPIPE, &sigpipe_action, 0); + sigaction(SIGPIPE, &sigpipe_action, NULL); memset(&sigterm_action, 0, sizeof(struct sigaction)); sigterm_action.sa_handler = &sigterm_handler; sigemptyset(&sigterm_action.sa_mask); - sigaction(SIGTERM, &sigterm_action, 0); + sigaction(SIGTERM, &sigterm_action, NULL); args = args_parse (); args->pAppPath = get_app_path( argv[0] ); @@ -884,7 +884,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS( argc, argv ) #endif status = child_get_exit_code(info); - g_pProcess = 0; // reset + g_pProcess = NULL; // reset switch (status) { case EXITHELPER_CRASH_WITH_RESTART: // re-start with just -env: parameters #if OSL_DEBUG_LEVEL > 1 |