home *** CD-ROM | disk | FTP | other *** search
- /*--------------------------------------*/
- /* */
- /* ADDBIT(X) */
- /* */
- /* Functionality: */
- /* Marks the first off bit of an */
- /* integer which is on when */
- /* scanning from right to left. */
- /* Arguments: */
- /* 0: The integer to scan. */
- /* Functions used: */
- /* POWER() */
- /* Returns: Nothing */
- /* Author: John Callicotte */
- /* Date created/modified: 09/01/88 */
- /* */
- /*--------------------------------------*/
-
- void addbit(b)
- int b[];
- {
- int d,j;
- if (b[0]==32767) /* No bits to turn on, so we leave */
- goto END;
- for (j=0;j<16;j++){
- d=power(2,j);
- if (b[0]<d){
- b[0]+=d;
- j=16;
- }
- }
-
- END: ;
- }