bool fixed_bit_vector_manager::equals(fixed_bit_vector const& a, fixed_bit_vector const& b) const { if (&a == &b) return true; unsigned n = num_words(); if (n == 0) return true; for (unsigned i = 0; i < n - 1; i++) { if (a.m_data[i] != b.m_data[i]) return false; } return last_word(a) == last_word(b); }
bool fixed_bit_vector_manager::contains(fixed_bit_vector const& a, fixed_bit_vector const& b) const { unsigned n = num_words(); if (n == 0) return true; for (unsigned i = 0; i < n - 1; ++i) { if ((a.m_data[i] & b.m_data[i]) != b.m_data[i]) return false; } unsigned b_data = last_word(b); return (last_word(a) & b_data) == b_data; }
int main(int argc, char **argv) { if (argc != 2) return (0); last_word(argv[1]); return (0); }
int main(int argc, char **argv) { if (argc == 2) last_word(argv[1]); write(1, "\n", 1); return (0); }
bool papuguj( CHAR_DATA *ch, char *argument ) { char buf[ 2 * MAX_INPUT_LENGTH ]; if ( !IS_AWAKE( ch ) ) return FALSE; buf[ 0 ] = '\0'; if ( argument ) { char *arg = last_word( argument ); if ( !arg || ( UPPER( *arg ) < 'A' || UPPER( *arg ) > 'Z' ) ) return FALSE; arg = przeciagaj( arg ); sprintf( buf, "%s! %s!", arg, arg ); } else { switch ( number_bits( 3 ) ) { case 0: case 1: case 2: strcat( buf, "Rrrrwa ma`c!" ); break; case 3: case 4: strcat( buf, "Daaaj orzeszka! Daaaj orzeszka!" ); break; case 5: strcat( buf, "Brrrawo! Brrawo!" ); break; case 6: strcat( buf, "Rrrratunku! Ucieka`c!" ); break; default:strcat( buf, "Grrrrratuluj`e!" ); } } do_say( ch, buf ); return TRUE; }
void userdata_update_last_word( userdata *u, char *line, int len ) { if ( u->last_word != NULL ) free( u->last_word ); u->last_word = last_word( line, len ); }