]> git.proxmox.com Git - libtpms.git/commitdiff
rev164: Change return types from BOOL to bool
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Mon, 22 Feb 2021 21:50:47 +0000 (16:50 -0500)
committerStefan Berger <stefanb@us.ibm.com>
Fri, 19 Mar 2021 19:59:52 +0000 (15:59 -0400)
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
src/tpm2/Simulator_fp.h
src/tpm2/TPMCmdp.c
src/tpm2/TcpServerPosix_fp.h

index 9923db06bdaea4ee992080b2e9372351004a42ff..aedcc9161d1dda1535827056bda1d018141af2b8 100644 (file)
@@ -3,7 +3,7 @@
 /*                                                     */
 /*                          Written by Ken Goldman                             */
 /*                    IBM Thomas J. Watson Research Center                     */
-/*            $Id: Simulator_fp.h 1519 2019-11-15 20:43:51Z kgoldman $         */
+/*            $Id: Simulator_fp.h 1658 2021-01-22 23:14:01Z kgoldman $         */
 /*                                                                             */
 /*  Licenses and Notices                                                       */
 /*                                                                             */
@@ -55,7 +55,7 @@
 /*    arising in any way out of use or reliance upon this specification or any         */
 /*    information herein.                                                      */
 /*                                                                             */
-/*  (c) Copyright IBM Corp. and others, 2016 - 2019                            */
+/*  (c) Copyright IBM Corp. and others, 2016 - 2021                            */
 /*                                                                             */
 /********************************************************************************/
 
@@ -63,7 +63,7 @@
 #ifndef    _SIMULATOR_FP_H_
 #define    _SIMULATOR_FP_H_
 
-#include "BaseTypes.h"
+#include <stdbool.h>
 
 #ifdef TPM_WINDOWS
 #include <windows.h>
@@ -88,7 +88,7 @@
    handler. */
 void
 _rpc__Signal_PowerOn(
-                    BOOL        isReset
+                    bool        isReset
                     );
 /* D.2.2.2. Signal_Restart() */
 /* This function processes the clock restart indication. All it does is call the platform
@@ -187,9 +187,9 @@ _rpc__RsaKeyCacheControl(
                         int              state
                         );
 /* D.4.2.15.   _rpc__ACT_GetSignaled() */
-BOOL
+bool
 _rpc__ACT_GetSignaled(
-                     UINT32 actHandle
+                     uint32_t actHandle
                      );
 
 /* D.2.3. From TPMCmds.c */
@@ -203,9 +203,9 @@ main(
 #endif /* libtpms added */
 /* libtpms added begin */
 void _rpc__Signal_SetTPMEstablished(void);
-BOOL _rpc__Signal_GetTPMEstablished(void);
+bool _rpc__Signal_GetTPMEstablished(void);
 void _rpc__Signal_ResetTPMEstablished(void);
-BOOL _rpc__Signal_IsPowerOn(void);
+bool _rpc__Signal_IsPowerOn(void);
 /* libtpms added end */
 
 #endif  // _SIMULATOR_FP_H_
index b290bcf3134f34da604403e61fe97ec6c5b8cee4..041b78035e0db975680e66918913dcff9b4a9af7 100644 (file)
@@ -3,7 +3,7 @@
 /*                       Process the commands                                  */
 /*                          Written by Ken Goldman                             */
 /*                    IBM Thomas J. Watson Research Center                     */
-/*            $Id: TPMCmdp.c 1594 2020-03-26 22:15:48Z kgoldman $              */
+/*            $Id: TPMCmdp.c 1658 2021-01-22 23:14:01Z kgoldman $              */
 /*                                                                             */
 /*  Licenses and Notices                                                       */
 /*                                                                             */
@@ -55,7 +55,7 @@
 /*    arising in any way out of use or reliance upon this specification or any         */
 /*    information herein.                                                      */
 /*                                                                             */
-/*  (c) Copyright IBM Corp. and others, 2016 - 2020                            */
+/*  (c) Copyright IBM Corp. and others, 2016 - 2021                            */
 /*                                                                             */
 /********************************************************************************/
 
@@ -69,6 +69,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <setjmp.h>
+#include <stdbool.h>
 #include "TpmBuildSwitches.h"
 #ifdef TPM_WINDOWS
 #include <windows.h>
 #endif
 #include "TpmProfile.h"                /* kgold */
 
-static BOOL     s_isPowerOn = FALSE;
+static bool     s_isPowerOn = false;
 /* D.4.3. Functions */
 /* D.4.3.1. Signal_PowerOn() */
 /* This function processes a power-on indication. Among other things, it calls the _TPM_Init()
    handler. */
 void
 _rpc__Signal_PowerOn(
-                    BOOL        isReset
+                    bool        isReset
                     )
 {
     // if power is on and this is not a call to do TPM reset then return
@@ -115,7 +116,7 @@ _rpc__Signal_PowerOn(
     // Power on and reset both lead to _TPM_Init()
     _plat__Signal_Reset();
     // Set state as power on
-    s_isPowerOn = TRUE;
+    s_isPowerOn = true;
 }
 #if 0 /* libtpms added */
 /* D.4.3.2. Signal_Restart() */
@@ -141,7 +142,7 @@ _rpc__Signal_PowerOff(
        // Pass power off signal to platform
        _plat__Signal_PowerOff();
     // This could be redundant, but...
-    s_isPowerOn = FALSE;
+    s_isPowerOn = false;
     return;
 }
 #if 0 /* libtpms added */
@@ -320,21 +321,21 @@ _rpc__RsaKeyCacheControl(
 
 /* D.4.2.15.   _rpc__ACT_GetSignaled() */
 /* This function is used to count the ACT second tick. */
-BOOL
+bool
 _rpc__ACT_GetSignaled(
-                     UINT32 actHandle
+                     uint32_t actHandle
                      )
 {
     // If TPM power is on
     if (s_isPowerOn)
        // Query the platform
        return _plat__ACT_GetSignaled(actHandle - TPM_RH_ACT_0);
-    return FALSE;
+    return false;
 }
 #endif /* libtpms added */
 
 /* libtpms added begin */
-static BOOL tpmEstablished;
+static bool tpmEstablished;
 
 void
 _rpc__Signal_SetTPMEstablished(void)
@@ -349,13 +350,13 @@ _rpc__Signal_ResetTPMEstablished(void)
     tpmEstablished = FALSE;
 }
 
-BOOL
+bool
 _rpc__Signal_GetTPMEstablished(void)
 {
     return tpmEstablished;
 }
 
-BOOL
+bool
 _rpc__Signal_IsPowerOn(void)
 {
     return s_isPowerOn;
index b03af55c51baa6ad22381cd0c6ab1b82d96077b3..d984130aec3bec110c3b6d5536fa511cc94f3dc0 100644 (file)
@@ -3,7 +3,7 @@
 /*                     Socket Interface to a TPM Simulator                     */
 /*                          Written by Ken Goldman                             */
 /*                    IBM Thomas J. Watson Research Center                     */
-/*            $Id: TcpServerPosix_fp.h 1528 2019-11-20 20:31:43Z kgoldman $    */
+/*            $Id: TcpServerPosix_fp.h 1658 2021-01-22 23:14:01Z kgoldman $    */
 /*                                                                             */
 /*  Licenses and Notices                                                       */
 /*                                                                             */
@@ -55,7 +55,7 @@
 /*    arising in any way out of use or reliance upon this specification or any         */
 /*    information herein.                                                      */
 /*                                                                             */
-/*  (c) Copyright IBM Corp. and others, 2016 - 2019                            */
+/*  (c) Copyright IBM Corp. and others, 2016 - 2021                            */
 /*                                                                             */
 /********************************************************************************/
 
@@ -71,7 +71,7 @@
 #include "CompilerDependencies.h"
 #include "BaseTypes.h"
 
-BOOL
+bool
 PlatformServer(
               SOCKET           s
               );
@@ -92,37 +92,37 @@ StartTcpServer(
               int              *PortNumber,
               int              *PortNumberPlatform
               );
-BOOL
+bool
 ReadBytes(
          SOCKET           s,
          char            *buffer,
          int              NumBytes
          );
-BOOL
+bool
 WriteBytes(
           SOCKET           s,
           char            *buffer,
           int              NumBytes
           );
-BOOL
+bool
 WriteUINT32(
            SOCKET           s,
            UINT32           val
            );
-BOOL
+bool
 ReadVarBytes(
             SOCKET           s,
             char            *buffer,
             UINT32          *BytesReceived,
             int              MaxLen
             );
-BOOL
+bool
 WriteVarBytes(
              SOCKET           s,
              char            *buffer,
              int              BytesToSend
              );
-BOOL
+bool
 TpmServer(
          SOCKET           s
          );