Просмотр исходного кода

defect 512 - some ais header file defines are wrong.

(Logical change 1.189)


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@624 fd59a12c-fef9-0310-b244-a6a79926bd2f
Steven Dake 21 лет назад
Родитель
Сommit
b99706a7e3
17 измененных файлов с 53 добавлено и 53 удалено
  1. 3 3
      include/ais_types.h
  2. 1 1
      include/saCkpt.h
  3. 1 1
      lib/evt.c
  4. 3 3
      test/evtbench.c
  5. 3 3
      test/publish.c
  6. 6 6
      test/subscription.c
  7. 2 2
      test/testamf.c
  8. 1 1
      test/testamf1.c
  9. 1 1
      test/testamf2.c
  10. 1 1
      test/testamf3.c
  11. 1 1
      test/testamf4.c
  12. 1 1
      test/testamf5.c
  13. 1 1
      test/testamf6.c
  14. 1 1
      test/testamfth.c
  15. 5 5
      test/testckpt.c
  16. 4 4
      test/testclm.c
  17. 18 18
      test/testevt.c

+ 3 - 3
include/ais_types.h

@@ -139,9 +139,9 @@ typedef enum {
 	SA_AIS_ERR_NO_SECTIONS = 27
 } SaAisErrorT;
 
-typedef int SaSelectionObjectT;
+typedef SaUint64T SaSelectionObjectT;
 
-typedef int SaInvocationT;
+typedef SaUint64T SaInvocationT;
 
 /*
  * AMF Definitions
@@ -290,7 +290,7 @@ typedef struct {
 	SaAmfRecommendedRecoveryT recommendedRecovery;
 } SaAmfErrorDescriptorT;
 
-typedef int SaSizeT;
+typedef SaUint64T SaSizeT;
 #define SA_AMF_OPAQUE_BUFFER_SIZE_MAX 512
 typedef struct {
 	char *buffer;

+ 1 - 1
include/saCkpt.h

@@ -102,7 +102,7 @@ typedef enum {
 	SA_CKPT_SECTIONS_ANY = 5
 } SaCkptSectionsChosenT;
 
-typedef SaUint32T SaOffsetT;
+typedef SaUint64T SaOffsetT;
 
 typedef struct {
 	SaCkptSectionIdT sectionId;

+ 1 - 1
lib/evt.c

@@ -423,7 +423,7 @@ static SaAisErrorT make_event(SaEvtEventHandleT *event_handle,
 		edi->edi_patterns.patterns[i].patternSize = pat->patternSize;
 		edi->edi_patterns.patterns[i].pattern = malloc(pat->patternSize);
 		if (!edi->edi_patterns.patterns[i].pattern) {
-			printf("make_event: couldn't alloc %d bytes\n", pat->patternSize);
+			printf("make_event: couldn't alloc %lld bytes\n", pat->patternSize);
 			error =  SA_AIS_ERR_NO_MEMORY;
 			break;
 		}

+ 3 - 3
test/evtbench.c

@@ -115,7 +115,7 @@ test_pub()
 	SaEvtChannelOpenFlagsT flags;
 	SaNameT channel_name;
 	uint64_t test_retention;
-	int fd;
+	SaSelectionObjectT fd;
 	int i;
 	struct timeval tv1, tv2, tv_elapsed;
 	int write_count = 10000;
@@ -290,7 +290,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
 	printf("event_callback called\n");
 	printf("sub ID: %x\n", subscription_id);
 	printf("event_handle %llx\n", (unsigned long long)event_handle);
-	printf("event data size %d\n", event_data_size);
+	printf("event data size %lld\n", event_data_size);
 
 	evt_pat_get_array.patternsNumber = 4;
 	result = saEvtEventAttributesGet(event_handle,
@@ -305,7 +305,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
 		printf("event get attr result(2): %d\n", result);
 		goto evt_free;
 	}
-	printf("pattern array count: %d\n", evt_pat_get_array.patternsNumber);
+	printf("pattern array count: %lld\n", evt_pat_get_array.patternsNumber);
 	for (i = 0; i < evt_pat_get_array.patternsNumber; i++) {
 		printf( "pattern %d =\"%s\"\n", i,
 				  evt_pat_get_array.patterns[i].pattern);

+ 3 - 3
test/publish.c

@@ -125,7 +125,7 @@ test_pub()
 	SaEvtChannelOpenFlagsT flags;
 	SaNameT channel_name;
 	uint64_t test_retention;
-	int fd;
+	SaSelectionObjectT fd;
 	int i;
 
 	SaEvtEventIdT event_id;
@@ -314,7 +314,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
 	printf("sub ID: %x\n", subscription_id);
 	printf("event_handle %llx\n", 
 			(unsigned long long)event_handle);
-	printf("event data size %d\n", event_data_size);
+	printf("event data size %lld\n", event_data_size);
 
 	evt_pat_get_array.patternsNumber = 4;
 	do {
@@ -332,7 +332,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
 		printf("event get attr result(2): %s\n", result_buf);
 		goto evt_free;
 	}
-	printf("pattern array count: %d\n", evt_pat_get_array.patternsNumber);
+	printf("pattern array count: %lld\n", evt_pat_get_array.patternsNumber);
 	for (i = 0; i < evt_pat_get_array.patternsNumber; i++) {
 		printf( "pattern %d =\"%s\"\n", i,
 				  evt_pat_get_array.patterns[i].pattern);

+ 6 - 6
test/subscription.c

@@ -94,7 +94,7 @@ test_subscription()
 
 	struct pollfd pfd;
 	int nfd;
-	int fd;
+	SaSelectionObjectT fd;
 	int timeout = 60000;
 	int i;
 
@@ -169,7 +169,7 @@ test_subscription()
 		}
 
 		if (pfd.revents & (POLLERR|POLLHUP)) {
-			printf("Error recieved on poll fd %d\n", fd);
+			printf("Error recieved on poll fd %lld\n", fd);
 			return SA_AIS_ERR_BAD_OPERATION;
 		}
 		do {
@@ -249,7 +249,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
 	if (!quiet)
 		dprintf("event_handle %llx\n", (unsigned long long)event_handle);
 	if (!quiet)
-		dprintf("event data size %d\n", event_data_size);
+		dprintf("event data size %lld\n", event_data_size);
 
 	evt_pat_get_array.patterns[0].patternSize = PAT_SIZE;
 	evt_pat_get_array.patterns[1].patternSize = PAT_SIZE;
@@ -270,7 +270,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
 		goto evt_free;
 	}
 	if (!quiet) {
-		dprintf("pattern array count: %d\n", 
+		dprintf("pattern array count: %lld\n", 
 				evt_pat_get_array.patternsNumber);
 		for (i = 0; i < evt_pat_get_array.patternsNumber; i++) {
 			dprintf( "pattern %d =\"%s\"\n", i,
@@ -332,7 +332,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
 #endif
 
 	if (event_data_size != user_data_size) {
-		dprintf("unexpected data size: e=%d, a=%d\n",
+		dprintf("unexpected data size: e=%d, a=%lld\n",
 				user_data_size, event_data_size);
 		goto evt_free;
 	} 
@@ -346,7 +346,7 @@ event_callback( SaEvtSubscriptionIdT subscription_id,
 		goto evt_free;
 	}
 	if (received_size != event_data_size) {
-		dprintf("event data mismatch e=%d, a=%d\n",
+		dprintf("event data mismatch e=%lld, a=%lld\n",
 				event_data_size, 
 				received_size);
 		goto evt_free;

+ 2 - 2
test/testamf.c

@@ -167,7 +167,7 @@ void CSIRemoveCallback (
 	const SaNameT *csiName,
 	const SaAmfCSIFlagsT *csiFlags)
 {
-	printf ("CSIRemoveCallback invocation id %x compName ", invocation);
+	printf ("CSIRemoveCallback invocation id %lld compName ", invocation);
 	printSaNameT ((SaNameT *)compName);
 	printf (" csiName ");
 	printSaNameT ((SaNameT *)csiName);
@@ -250,7 +250,7 @@ int main (int argc, char **argv) {
 	SaAmfHandleT handle;
 	SaAmfHandleT handleproxy;
 	int result;
-	int select_fd;
+	SaSelectionObjectT select_fd;
 	fd_set read_fds;
 	SaNameT compName;
 	SaNameT csiName;

+ 1 - 1
test/testamf1.c

@@ -246,7 +246,7 @@ void sigintr_handler (int signum) {
 int main (int argc, char **argv) {
 	SaAmfHandleT handle;
 	int result;
-	int select_fd;
+	SaSelectionObjectT select_fd;
 	fd_set read_fds;
 	SaNameT compName;
 	extern char *optarg;

+ 1 - 1
test/testamf2.c

@@ -241,7 +241,7 @@ void sigintr_handler (int signum) {
 int main (int argc, char **argv) {
 	SaAmfHandleT handle;
 	int result;
-	int select_fd;
+	SaSelectionObjectT select_fd;
 	fd_set read_fds;
 	SaNameT compName;
 	int c,i;

+ 1 - 1
test/testamf3.c

@@ -242,7 +242,7 @@ void sigintr_handler (int signum) {
 int main (int argc, char **argv) {
 	SaAmfHandleT handle;
 	int result;
-	int select_fd;
+	SaSelectionObjectT select_fd;
 	fd_set read_fds;
 	SaNameT compName;
 	extern char *optarg;

+ 1 - 1
test/testamf4.c

@@ -242,7 +242,7 @@ void sigintr_handler (int signum) {
 int main (int argc, char **argv) {
 	SaAmfHandleT handle;
 	int result;
-	int select_fd;
+	SaSelectionObjectT select_fd;
 	fd_set read_fds;
 	SaNameT compName;
 	extern char *optarg;

+ 1 - 1
test/testamf5.c

@@ -240,7 +240,7 @@ void sigintr_handler (int signum) {
 int main (int argc, char **argv) {
 	SaAmfHandleT handle;
 	int result;
-	int select_fd;
+	SaSelectionObjectT select_fd;
 	fd_set read_fds;
 	SaNameT compName;
 	extern char *optarg;

+ 1 - 1
test/testamf6.c

@@ -240,7 +240,7 @@ void sigintr_handler (int signum) {
 int main (int argc, char **argv) {
 	SaAmfHandleT handle;
 	int result;
-	int select_fd;
+	SaSelectionObjectT select_fd;
 	fd_set read_fds;
 	SaNameT compName;
 	extern char *optarg;

+ 1 - 1
test/testamfth.c

@@ -259,7 +259,7 @@ int main (void) {
 
 	pthread_attr_init (&dispatch_thread_attribute);
 	pthread_attr_setschedpolicy (&dispatch_thread_attribute, SCHED_FIFO);
-	pthread_attr_setschedparam (&dispatch_thread_attribute, 99);
+//	pthread_attr_setschedparam (&dispatch_thread_attribute, 99);
 	pthread_create (&dispatch_thread, NULL, th_dispatch, &handle);
 
 	sleep (5);

+ 5 - 5
test/testckpt.c

@@ -201,7 +201,7 @@ int main (void) {
 	struct timeval tv_start;
 	struct timeval tv_end;
 	struct timeval tv_elapsed;
-	int sel_fd;
+	SaSelectionObjectT sel_fd;
 	
     error = saCkptInitialize (&ckptHandle, &callbacks, &version);
 
@@ -467,12 +467,12 @@ printf ("Please wait, testing expiry of checkpoint sections.\n");
 		printf ("%s: Get next section in iteartion\n",
 			get_test_output (error, SA_AIS_OK));
 		if (error == SA_OK) {
-			printf ("Section '%s' expires %llx size %d state %x update %llx\n",
+			printf ("Section '%s' expires %llx size %lld state %x update %llx\n",
 				sectionDescriptor.sectionId.id,
-				(unsigned long long)sectionDescriptor.expirationTime,
+				sectionDescriptor.expirationTime,
 				sectionDescriptor.sectionSize,
 				sectionDescriptor.sectionState,
-				(unsigned long long)sectionDescriptor.lastUpdate);
+				sectionDescriptor.lastUpdate);
 		}
 	} while (error == SA_OK);
 	printf ("The last iteration should fail\n");
@@ -482,7 +482,7 @@ printf ("Please wait, testing expiry of checkpoint sections.\n");
 		get_test_output (error, SA_AIS_OK));
 
 	error = saCkptSelectionObjectGet (ckptHandle, &sel_fd);
-	printf ("%s: Retrieve selection object %d\n",
+	printf ("%s: Retrieve selection object %lld\n",
 		get_test_output (error, SA_AIS_OK), sel_fd);
 
 	error = saCkptFinalize (ckptHandle);

+ 4 - 4
test/testclm.c

@@ -88,9 +88,9 @@ void NodeGetCallback (
 	char buf[128];
 
 	if (error != SA_AIS_OK) {
-		printf ("Node for invocation %d not found (%d)\n", invocation, error);
+		printf ("Node for invocation %lld not found (%d)\n", invocation, error);
 	} else {
-		sprintf (buf, "NODEGETCALLBACK %d\n", invocation);
+		sprintf (buf, "NODEGETCALLBACK %lld\n", invocation);
 		printSaClmClusterNodeT (buf, (SaClmClusterNodeT *)clusterNode);
 	}
 }
@@ -139,7 +139,7 @@ void sigintr_handler (int signum) {
 int main (void) {
 	SaClmHandleT handle;
 	fd_set read_fds;
-	int select_fd;
+	SaSelectionObjectT select_fd;
 	int result;
 	SaClmClusterNotificationT clusterNotification[64];
 	SaClmClusterNotificationBufferT clusterNotificationBuffer;
@@ -183,7 +183,7 @@ int main (void) {
 
 	saClmSelectionObjectGet (handle, &select_fd);
 
-printf ("select fd is %d\n", select_fd);
+printf ("select fd is %lld\n", select_fd);
 	FD_ZERO (&read_fds);
 printf ("press the enter key to exit with track stop and finalize.\n");
 	do {

+ 18 - 18
test/testevt.c

@@ -202,7 +202,7 @@ void open_callback(SaInvocationT invocation,
 		return;
 	}
 	if (invocation != open_invocation) {
-		printf("ERROR: Unexpected invocation value: e 0x%x, a 0x%x\n",
+		printf("ERROR: Unexpected invocation value: e 0x%llx, a 0x%llx\n",
 				open_invocation, invocation);
 	}
 
@@ -241,7 +241,7 @@ test_channel()
 
 	struct pollfd pfd;
 	int nfd;
-	int fd;
+	SaSelectionObjectT fd;
 	int timeout = 5000;
 	 
 	flags = SA_EVT_CHANNEL_PUBLISHER |
@@ -766,7 +766,7 @@ event_callback(SaEvtSubscriptionIdT my_subscription_id,
 				subscription_id, my_subscription_id);
 	}
 	if (my_event_data_size != event_data_size) {
-		printf("ERROR: event data size e=%d, a=%d\n", 
+		printf("ERROR: event data size e=%lld, a=%lld\n", 
 				event_data_size,
 				my_event_data_size);
 	}
@@ -794,13 +794,13 @@ event_callback(SaEvtSubscriptionIdT my_subscription_id,
 	}
 
 	if (evt_pat_get_array.patternsNumber != 4) {
-		printf("ERROR: pattern array count not 4: %d\n", 
+		printf("ERROR: pattern array count not 4: %lld\n", 
 					evt_pat_get_array.patternsNumber);
 	}
 	for (i = 0; i < evt_pat_get_array.patternsNumber; i++) {
 		if (evt_pat_get_array.patterns[i].patternSize !=
 				evt_pat_set_array.patterns[i].patternSize) {
-			printf("ERROR: pattern %d count not equal g=%d, s=%d\n",
+			printf("ERROR: pattern %d count not equal g=%lld, s=%lld\n",
 				i,
 				evt_pat_get_array.patterns[i].patternSize,
 				evt_pat_set_array.patterns[i].patternSize);
@@ -855,7 +855,7 @@ event_callback(SaEvtSubscriptionIdT my_subscription_id,
 		goto dat_free;
 	}
 	if (data_size != event_data_size) {
-		printf("ERROR: Data size: e=%d a=%d\n", 
+		printf("ERROR: Data size: e=%lld a=%lld\n", 
 				event_data_size, data_size);
 	}
 	for (i = 0; i < (data_size/sizeof(long)); i++) {
@@ -890,7 +890,7 @@ test_event()
 	SaTimeT publish_time;
 	struct pollfd pfd;
 	int nfd;
-	int fd;
+	SaSelectionObjectT fd;
 	int timeout = 5000;
 
 
@@ -976,7 +976,7 @@ test_event()
 		goto evt_free;
 	}
 	if (evt_pat_get_array.patternsNumber != 0) {
-		printf("ERROR: pattern array count not zero: %d\n", 
+		printf("ERROR: pattern array count not zero: %lld\n", 
 					evt_pat_get_array.patternsNumber);
 	}
 	if (priority != SA_EVT_LOWEST_PRIORITY) {
@@ -1029,13 +1029,13 @@ test_event()
 		goto evt_free;
 	}
 	if (evt_pat_get_array.patternsNumber != 4) {
-		printf("ERROR: pattern array count not 4: %d\n", 
+		printf("ERROR: pattern array count not 4: %lld\n", 
 					evt_pat_get_array.patternsNumber);
 	}
 	for (i = 0; i < evt_pat_get_array.patternsNumber; i++) {
 		if (evt_pat_get_array.patterns[i].patternSize !=
 				evt_pat_set_array.patterns[i].patternSize) {
-			printf("ERROR: pattern %d count not equal g=%d, s=%d\n",
+			printf("ERROR: pattern %d count not equal g=%lld, s=%lld\n",
 				i,
 				evt_pat_get_array.patterns[i].patternSize,
 				evt_pat_set_array.patterns[i].patternSize);
@@ -1366,7 +1366,7 @@ multi_test_callback1(SaEvtSubscriptionIdT my_subscription_id,
 	}
 
 	if (evt_pat_get_array.patternsNumber != 1) {
-		printf("ERROR: pattern array count not 1: %d\n", 
+		printf("ERROR: pattern array count not 1: %lld\n", 
 					evt_pat_get_array.patternsNumber);
 	}
 
@@ -1423,7 +1423,7 @@ test_multi_channel1()
 
 	struct pollfd pfd;
 	int nfd;
-	int fd;
+	SaSelectionObjectT fd;
 	int timeout = 5000;
 
 
@@ -1717,7 +1717,7 @@ multi_test_callback2(SaEvtSubscriptionIdT my_subscription_id,
 	}
 
 	if (evt_pat_get_array.patternsNumber != 1) {
-		printf("ERROR: pattern array count not 1: %d\n", 
+		printf("ERROR: pattern array count not 1: %lld\n", 
 					evt_pat_get_array.patternsNumber);
 	}
 
@@ -1763,7 +1763,7 @@ test_multi_channel2()
 
 	struct pollfd pfd;
 	int nfd;
-	int fd;
+	SaSelectionObjectT fd;
 	int timeout = 5000;
 
 
@@ -2017,7 +2017,7 @@ multi_test_callback3(SaEvtSubscriptionIdT my_subscription_id,
 	}
 
 	if (evt_pat_get_array.patternsNumber != 1) {
-		printf("ERROR: pattern array count not 1: %d\n", 
+		printf("ERROR: pattern array count not 1: %lld\n", 
 					evt_pat_get_array.patternsNumber);
 	}
 
@@ -2066,7 +2066,7 @@ test_multi_channel3()
 
 	struct pollfd pfd;
 	int nfd;
-	int fd;
+	SaSelectionObjectT fd;
 	int timeout = 5000;
 
 
@@ -2362,7 +2362,7 @@ test_retention()
 
 	struct pollfd pfd;
 	int nfd;
-	int fd;
+	SaSelectionObjectT fd;
 	int timeout = (EXPIRE_TIME + 5);
 	SaAisErrorT result;
 	 
@@ -2794,7 +2794,7 @@ test_unlink_channel()
 
 	struct pollfd pfd;
 	int nfd;
-	int fd;
+	SaSelectionObjectT fd;
 	int timeout = 5000;
 	 
 	flags1 = SA_EVT_CHANNEL_PUBLISHER |