int coro_test_2( co_t *co_p ) { static int i; if ( *co_p ) goto **co_p; /* begin */ for ( i = 0; i < CYCLE_COUNT; i++ ) { do { /* acquire */ do { /* wait */ *co_p = &&L__1; L__1: if (!( b_empty > 0 )) { /* cond */ return CO_WAIT; } } while ( 0 ); --b_empty; } while ( 0 ); check_mark( b_get()); do { /* release */ ++b_full; } while ( 0 ); } /* end */ *co_p = &&L__END_test_2; L__END_test_2: return CO_END; }
DIR_ENTRY CBlock::b_get_dir_entry(int b_pos) { // 如果块中剩下的字节数不足16字节(一个目录项长度) if (SIZE_PER_BLOCK - b_pos < 16) exit(-1); // because this should never happen! char temp[16]; for (int i = 0; i < 16; i++) { temp[i] = b_get(b_pos++); } DIR_ENTRY d_temp; d_temp.d_inode = temp[0]; // int->char std::copy(temp+4, temp+16, d_temp.d_name); return d_temp; }