src/dpdk/lib/librte_eal/windows/getopt.c
static void
permute_args(int panonopt_start, int panonopt_end, int opt_end,
	char **nargv)
{
	int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos;
	char *swap;

	/*
	 * compute lengths of blocks and number and size of cycles
	 */
	nnonopts = panonopt_end - panonopt_start;
	nopts = opt_end - panonopt_end;
	ncycle = gcd(nnonopts, nopts);
	cyclelen = (opt_end - panonopt_start) / ncycle;

	for (i = 0; i < ncycle; i++) {
		cstart = panonopt_end+i;
		pos = cstart;
		for (j = 0; j < cyclelen; j++) {
			if (pos >= panonopt_end)
				pos -= nnonopts;
			else
				pos += nopts;
			swap = nargv[pos];
			/* LINTED const cast */
			((char **) nargv)[pos] = nargv[cstart];
			/* LINTED const cast */
			((char **)nargv)[cstart] = swap;
		}
	}
}
/*
 * Exchange the block from nonopt_start to nonopt_end with the block
 * from nonopt_end to opt_end (keeping the same order of arguments
 * in each block).
 */
Exchange the block from nonopt_start to nonopt_end with the block
from nonopt_end to opt_end (keeping the same order of arguments
in each block).
Exchange the block from nonopt_start to nonopt_end with the block from nonopt_end to opt_end ( keeping the same order of arguments in each block ) .
static void
permute_args(int panonopt_start, int panonopt_end, int opt_end,
	char **nargv)
{
	int cstart, cyclelen, i, j, ncycle, nnonopts, nopts, pos;
	char *swap;
	nnonopts = panonopt_end - panonopt_start;
	nopts = opt_end - panonopt_end;
	ncycle = gcd(nnonopts, nopts);
	cyclelen = (opt_end - panonopt_start) / ncycle;
	for (i = 0; i < ncycle; i++) {
		cstart = panonopt_end+i;
		pos = cstart;
		for (j = 0; j < cyclelen; j++) {
			if (pos >= panonopt_end)
				pos -= nnonopts;
			else
				pos += nopts;
			swap = nargv[pos];
			((char **) nargv)[pos] = nargv[cstart];
			((char **)nargv)[cstart] = swap;
		}
	}
}
static void permute_args ( int panonopt_start , int panonopt_end , int opt_end , char * * nargv ) { int cstart , cyclelen , i , j , ncycle , nnonopts , nopts , pos ; char * swap ; nnonopts = panonopt_end - panonopt_start ; nopts = opt_end - panonopt_end ; ncycle = gcd ( nnonopts , nopts ) ; cyclelen = ( opt_end - panonopt_start ) / ncycle ; for ( i = 0 ; i < ncycle ; i ++ ) { cstart = panonopt_end + i ; pos = cstart ; for ( j = 0 ; j < cyclelen ; j ++ ) { if ( pos >= panonopt_end ) pos -= nnonopts ; else pos += nopts ; swap = nargv [ pos ] ; ( ( char * * ) nargv ) [ pos ] = nargv [ cstart ] ; ( ( char * * ) nargv ) [ cstart ] = swap ; } } }
Exchange the block from nonopt_start to nonopt_end with the block
 from nonopt_end to opt_end (keeping the same order of arguments
 in each block).
Exchange the block from nonopt_start to nonopt_end with the block from nonopt_end to opt_end ( keeping the same order of arguments in each block ) .
/*
	 * compute lengths of blocks and number and size of cycles
	 */ /* LINTED const cast */ /* LINTED const cast */