MCPcopy Index your code
hub / github.com/RsyncProject/rsync / poptSaveInt

Function poptSaveInt

popt/popt.c:993–1016  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

991}
992
993int poptSaveInt(int * arg, unsigned int argInfo, long aLong)
994{
995 /* XXX Check alignment, may fail on funky platforms. */
996 if (arg == NULL || (((unsigned long)arg) & (ALIGNOF(*arg)-1)))
997 return POPT_ERROR_NULLARG;
998
999 if (aLong != 0 && LF_ISSET(RANDOM)) {
1000 aLong = (int)poptRandomValue(aLong);
1001 if (aLong < 0)
1002 return aLong;
1003 }
1004 if (LF_ISSET(NOT))
1005 aLong = ~aLong;
1006 switch (LF_ISSET(LOGICALOPS)) {
1007 case 0: *arg = (int) aLong; break;
1008 case POPT_ARGFLAG_OR: *(unsigned int *)arg |= (unsigned int) aLong; break;
1009 case POPT_ARGFLAG_AND: *(unsigned int *)arg &= (unsigned int) aLong; break;
1010 case POPT_ARGFLAG_XOR: *(unsigned int *)arg ^= (unsigned int) aLong; break;
1011 default:
1012 return POPT_ERROR_BADOPERATION;
1013 break;
1014 }
1015 return 0;
1016}
1017
1018int poptSaveShort(short * arg, unsigned int argInfo, long aLong)
1019{

Callers 2

poptSaveArgFunction · 0.85
poptGetNextOptFunction · 0.85

Calls 1

poptRandomValueFunction · 0.85

Tested by

no test coverage detected