[Libreoffice-commits] core.git: desktop/unx

Chris Sherlock chris.sherlock79 at gmail.com
Tue Aug 29 13:55:02 UTC 2017


 desktop/unx/source/start.c |   86 ++++++++++++++++++++++-----------------------
 1 file changed, 43 insertions(+), 43 deletions(-)

New commits:
commit 06c3fd26fbb1ab086be938bb3b61794472b80782
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Tue Aug 29 23:49:41 2017 +1000

    revert 36e31c6a6fbbeebd4825f318ebae2ea6c7e6719f
    
    Change-Id: If5039ab54df40f263a947c83fceba4d844467a88

diff --git a/desktop/unx/source/start.c b/desktop/unx/source/start.c
index d864e3f4a9fd..681fe15e2882 100644
--- a/desktop/unx/source/start.c
+++ b/desktop/unx/source/start.c
@@ -44,7 +44,7 @@
 /* Easier conversions: rtl_uString to rtl_String */
 static rtl_String *ustr_to_str(rtl_uString *pStr)
 {
-    rtl_String *pOut = nullptr;
+    rtl_String *pOut = NULL;
 
     rtl_uString2String(&pOut, rtl_uString_getStr(pStr),
             rtl_uString_getLength(pStr), osl_getThreadTextEncoding(), OUSTRING_TO_OSTRING_CVTFLAGS);
@@ -55,7 +55,7 @@ static rtl_String *ustr_to_str(rtl_uString *pStr)
 /* Easier conversions: char * to rtl_uString */
 static rtl_uString *charp_to_ustr(const char *pStr)
 {
-    rtl_uString *pOut = nullptr;
+    rtl_uString *pOut = NULL;
 
     rtl_string2UString(&pOut, pStr, strlen(pStr), osl_getThreadTextEncoding(), OSTRING_TO_OUSTRING_CVTFLAGS);
 
@@ -83,7 +83,7 @@ child_info_destroy(ChildInfo *info)
 
 static ChildInfo * child_spawn(Args *args, bool bAllArgs, bool bWithStatus)
 {
-    rtl_uString *pApp = nullptr, *pTmp = nullptr;
+    rtl_uString *pApp = NULL, *pTmp = NULL;
     rtl_uString **ppArgs;
     sal_uInt32 nArgs, i;
     ChildInfo *info;
@@ -106,7 +106,7 @@ static ChildInfo * child_spawn(Args *args, bool bAllArgs, bool bWithStatus)
     rtl_uString_newFromAscii(&pTmp, "soffice.bin");
     rtl_uString_newConcat(&pApp, pApp, pTmp);
     rtl_uString_release(pTmp);
-    pTmp = nullptr;
+    pTmp = NULL;
 
     /* copy args */
     nArgs = bAllArgs ? args->nArgsTotal : args->nArgsEnv;
@@ -128,9 +128,9 @@ static ChildInfo * child_spawn(Args *args, bool bAllArgs, bool bWithStatus)
     /* start the main process */
     nError = osl_executeProcess(pApp, ppArgs, nArgs,
                                 osl_Process_NORMAL,
-                                nullptr,
-                                nullptr,
-                                nullptr, 0,
+                                NULL,
+                                NULL,
+                                NULL, 0,
                                 &info->child );
 
     if (pTmp)
@@ -196,7 +196,7 @@ static rtl_uString *get_app_path(const char *pAppExec)
     len = rtl_uString_getLength(pResult);
     if (len > 0 && rtl_uString_getStr(pResult)[len - 1] != '/')
     {
-        rtl_uString *pSlash = nullptr;
+        rtl_uString *pSlash = NULL;
         rtl_uString_newFromAscii(&pSlash, "/");
         rtl_uString_newConcat(&pResult, pResult, pSlash);
         rtl_uString_release(pSlash);
@@ -208,26 +208,26 @@ static rtl_uString *get_app_path(const char *pAppExec)
 /* Compute the OOo md5 hash from 'pText' */
 static rtl_uString *get_md5hash(rtl_uString *pText)
 {
-    rtl_uString *pResult = nullptr;
+    rtl_uString *pResult = NULL;
     sal_Int32 nCapacity = 100;
-    unsigned char *pData = nullptr;
+    unsigned char *pData = NULL;
     sal_uInt32 nSize = 0;
     rtlDigest digest;
     sal_uInt32 md5_key_len = 0;
-    sal_uInt8* md5_buf = nullptr;
+    sal_uInt8* md5_buf = NULL;
     sal_uInt32 i = 0;
 
     if ( !pText )
-        return nullptr;
+        return NULL;
 
     pData = (unsigned char *)rtl_uString_getStr(pText);
     nSize = rtl_uString_getLength(pText) * sizeof(sal_Unicode);
     if (!pData)
-        return nullptr;
+        return NULL;
 
     digest = rtl_digest_create(rtl_Digest_AlgorithmMD5);
     if (!digest)
-        return nullptr;
+        return NULL;
 
     md5_key_len = rtl_digest_queryLength(digest);
     md5_buf = (sal_uInt8 *)calloc(md5_key_len, sizeof(sal_uInt8));
@@ -258,10 +258,10 @@ static rtl_uString *get_md5hash(rtl_uString *pText)
 /* Construct the pipe name */
 static rtl_uString *get_pipe_path(rtl_uString *pAppPath)
 {
-    rtl_uString *pPath = nullptr, *pTmp = nullptr, *pUserInstallation = nullptr;
-    rtl_uString *pResult = nullptr, *pBasePath = nullptr, *pAbsUserInstallation = nullptr;
+    rtl_uString *pPath = NULL, *pTmp = NULL, *pUserInstallation = NULL;
+    rtl_uString *pResult = NULL, *pBasePath = NULL, *pAbsUserInstallation = NULL;
     rtlBootstrapHandle handle;
-    rtl_uString *pMd5hash = nullptr;
+    rtl_uString *pMd5hash = NULL;
     sal_Unicode pUnicode[RTL_USTR_MAX_VALUEOFINT32];
 
     /* setup bootstrap filename */
@@ -275,7 +275,7 @@ static rtl_uString *get_pipe_path(rtl_uString *pAppPath)
     handle = rtl_bootstrap_args_open(pPath);
 
     rtl_uString_newFromAscii(&pTmp, "UserInstallation");
-    rtl_bootstrap_get_from_handle(handle, pTmp, &pUserInstallation, nullptr);
+    rtl_bootstrap_get_from_handle(handle, pTmp, &pUserInstallation, NULL);
 
     rtl_bootstrap_args_close(handle);
 
@@ -367,7 +367,7 @@ static int connect_pipe(rtl_uString *pPipePath)
 /* Escape: "," -> "\\,", "\0" -> "\\0", "\\" -> "\\\\" */
 static rtl_uString *escape_path(rtl_uString *pToEscape)
 {
-    rtl_uString *pBuffer = nullptr;
+    rtl_uString *pBuffer = NULL;
     sal_Int32 nCapacity = 1000;
     sal_Int32 i = 0;
     sal_Int32 nEscapeLength = rtl_uString_getLength(pToEscape);
@@ -407,9 +407,9 @@ static rtl_uString *escape_path(rtl_uString *pToEscape)
 /* Send args to the LO instance (using the 'fd' file descriptor) */
 static bool send_args(int fd, rtl_uString *pCwdPath)
 {
-    rtl_uString *pBuffer = nullptr, *pTmp = nullptr;
+    rtl_uString *pBuffer = NULL, *pTmp = NULL;
     sal_Int32 nCapacity = 1000;
-    rtl_String *pOut = nullptr;
+    rtl_String *pOut = NULL;
     bool bResult;
     size_t nLen;
     rtl_uString *pEscapedCwdPath = escape_path(pCwdPath);
@@ -443,7 +443,7 @@ static bool send_args(int fd, rtl_uString *pCwdPath)
 
     for (nArg = 0; nArg < nArgCount; ++nArg)
     {
-        rtl_uString *pEscapedTmp = nullptr;
+        rtl_uString *pEscapedTmp = NULL;
         rtl_uStringbuffer_insert_ascii(&pBuffer, &nCapacity,
                 rtl_uString_getLength(pBuffer),
                 ",", 1);
@@ -582,7 +582,7 @@ void exec_pagein (Args *args)
 
 static void extend_library_path(const char *new_element)
 {
-    rtl_uString *pEnvName=nullptr, *pOrigEnvVar=nullptr, *pNewEnvVar=nullptr;
+    rtl_uString *pEnvName=NULL, *pOrigEnvVar=NULL, *pNewEnvVar=NULL;
     const char *pathname;
 #ifdef AIX
     pathname = "LIBPATH";
@@ -596,7 +596,7 @@ static void extend_library_path(const char *new_element)
     osl_getEnvironment(pEnvName, &pOrigEnvVar);
     if (pOrigEnvVar && pOrigEnvVar->length)
     {
-        rtl_uString *pDelim = nullptr;
+        rtl_uString *pDelim = NULL;
         rtl_uString_newFromAscii(&pDelim, ":");
         rtl_uString_newConcat(&pNewEnvVar, pNewEnvVar, pDelim);
         rtl_uString_newConcat(&pNewEnvVar, pNewEnvVar, pOrigEnvVar);
@@ -620,8 +620,8 @@ static void exec_javaldx(Args *args)
     rtl_uString **ppArgs;
     rtl_uString *pTmp, *pTmp2;
 
-    oslProcess javaldx = nullptr;
-    oslFileHandle fileOut = nullptr;
+    oslProcess javaldx = NULL;
+    oslFileHandle fileOut = NULL;
     oslProcessError err;
 
     ppArgs = (rtl_uString **)calloc(args->nArgsEnv + 2, sizeof(rtl_uString*));
@@ -630,10 +630,10 @@ static void exec_javaldx(Args *args)
         ppArgs[nArgs] = args->ppArgs[nArgs];
 
     /* Use absolute path to redirectrc */
-    pTmp = nullptr;
+    pTmp = NULL;
     rtl_uString_newFromAscii(&pTmp, "-env:INIFILENAME=vnd.sun.star.pathname:");
     rtl_uString_newConcat(&pTmp, pTmp, args->pAppPath);
-    pTmp2 = nullptr;
+    pTmp2 = NULL;
     rtl_uString_newFromAscii(&pTmp2, "redirectrc");
     rtl_uString_newConcat(&pTmp, pTmp, pTmp2);
     ppArgs[nArgs] = pTmp;
@@ -641,23 +641,23 @@ static void exec_javaldx(Args *args)
     nArgs++;
 
     /* And also to javaldx */
-    pApp = nullptr;
+    pApp = NULL;
     rtl_uString_newFromAscii(&pApp, "file://");
     rtl_uString_newConcat(&pApp, pApp, args->pAppPath);
-    pTmp = nullptr;
+    pTmp = NULL;
     rtl_uString_newFromAscii(&pTmp, "javaldx");
     rtl_uString_newConcat(&pApp, pApp, pTmp);
     rtl_uString_release(pTmp);
 
     err = osl_executeProcess_WithRedirectedIO(pApp, ppArgs, nArgs,
                                               osl_Process_NORMAL,
-                                              nullptr, // security
-                                              nullptr, // work dir
-                                              nullptr, 0,
+                                              NULL, // security
+                                              NULL, // work dir
+                                              NULL, 0,
                                               &javaldx, // process handle
-                                              nullptr,
+                                              NULL,
                                               &fileOut,
-                                              nullptr);
+                                              NULL);
 
     rtl_uString_release(ppArgs[nArgs-1]);
     rtl_uString_release(pApp);
@@ -712,7 +712,7 @@ static void exec_javaldx(Args *args)
 #endif
 
 // has to be a global :(
-static oslProcess * volatile g_pProcess = nullptr;
+static oslProcess * volatile g_pProcess = NULL;
 
 void sigterm_handler(int ignored)
 {
@@ -729,10 +729,10 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
 {
     bool bSentArgs = false;
     const char* pUsePlugin;
-    rtl_uString *pPipePath = nullptr;
+    rtl_uString *pPipePath = NULL;
     Args *args;
     int status = 0;
-    struct splash* splash = nullptr;
+    struct splash* splash = NULL;
     struct sigaction sigpipe_action;
     struct sigaction sigterm_action;
 
@@ -740,11 +740,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, nullptr);
+    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, nullptr);
+    sigaction(SIGTERM, &sigterm_action, NULL);
 
     args = args_parse();
     args->pAppPath = get_app_path(argv[0]);
@@ -777,7 +777,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
                 (memcmp(resp, "InternalIPC::SendArguments",
                         SAL_N_ELEMENTS(resp) - 1) == 0))
             {
-                rtl_uString *pCwdPath = nullptr;
+                rtl_uString *pCwdPath = NULL;
                 osl_getProcessWorkingDir(&pCwdPath);
 
                 // Then send args
@@ -835,13 +835,13 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
                 if (eResult != ProgressContinue)
                 {
                     splash_destroy(splash);
-                    splash = nullptr;
+                    splash = NULL;
                     bShortWait = false;
                 }
             }
 
             status = child_get_exit_code(info);
-            g_pProcess = nullptr; // reset
+            g_pProcess = NULL; // reset
 
             switch (status)
             {


More information about the Libreoffice-commits mailing list