Changeset f1d6866 in mainline for uspace/lib/c


Ignore:
Timestamp:
2011-09-18T21:22:59Z (15 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dcc44ca1
Parents:
85ff862 (diff), 45a9cf4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

Location:
uspace/lib/c
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/Makefile

    r85ff862 rf1d6866  
    6363        generic/as.c \
    6464        generic/cap.c \
     65        generic/cfg.c \
    6566        generic/clipboard.c \
    6667        generic/devman.c \
  • uspace/lib/c/generic/adt/hash_table.c

    r85ff862 rf1d6866  
    152152       
    153153        if (keys == h->max_keys) {
    154                 link_t *cur;
    155                
    156154                /*
    157155                 * All keys are known, hash_table_find() can be used to find the
     
    159157                 */
    160158               
    161                 cur = hash_table_find(h, key);
     159                link_t *cur = hash_table_find(h, key);
    162160                if (cur) {
    163161                        list_remove(cur);
     
    174172        hash_index_t chain;
    175173        for (chain = 0; chain < h->entries; chain++) {
    176                 link_t *cur;
    177                
    178                 for (cur = h->entry[chain].head.next; cur != &h->entry[chain].head;
     174                for (link_t *cur = h->entry[chain].head.next;
     175                    cur != &h->entry[chain].head;
    179176                    cur = cur->next) {
    180177                        if (h->op->compare(key, keys, cur)) {
  • uspace/lib/c/generic/as.c

    r85ff862 rf1d6866  
    123123 * @retval ENOENT Mapping not found.
    124124 */
    125 int as_get_physical_mapping(void *address, uintptr_t *frame)
     125int as_get_physical_mapping(const void *address, uintptr_t *frame)
    126126{
    127127        uintptr_t tmp_frame;
  • uspace/lib/c/generic/io/io.c

    r85ff862 rf1d6866  
    418418
    419419        bytes_used = stream->buf_head - stream->buf_tail;
    420         if (bytes_used == 0)
    421                 return;
    422420
    423421        /* If buffer has prefetched read data, we need to seek back. */
    424         if (stream->buf_state == _bs_read)
     422        if (bytes_used > 0 && stream->buf_state == _bs_read)
    425423                lseek(stream->fd, - (ssize_t) bytes_used, SEEK_CUR);
    426424
    427425        /* If buffer has unwritten data, we need to write them out. */
    428         if (stream->buf_state == _bs_write)
     426        if (bytes_used > 0 && stream->buf_state == _bs_write)
    429427                (void) _fwrite(stream->buf_tail, 1, bytes_used, stream);
    430428
  • uspace/lib/c/generic/ns.c

    r85ff862 rf1d6866  
    5252{
    5353        async_exch_t *exch = async_exchange_begin(session_ns);
     54        if (!exch)
     55                return NULL;
    5456        async_sess_t *sess =
    5557            async_connect_me_to(mgmt, exch, service, arg2, arg3);
    5658        async_exchange_end(exch);
     59
     60        if (!sess)
     61                return NULL;
    5762       
    5863        /*
  • uspace/lib/c/include/adt/list.h

    r85ff862 rf1d6866  
    173173 *
    174174 */
    175 static inline int list_empty(list_t *list)
     175static inline int list_empty(const list_t *list)
    176176{
    177177        return (list->head.next == &list->head);
     
    186186 *
    187187 */
    188 static inline link_t *list_first(list_t *list)
     188static inline link_t *list_first(const list_t *list)
    189189{
    190190        return ((list->head.next == &list->head) ? NULL : list->head.next);
  • uspace/lib/c/include/as.h

    r85ff862 rf1d6866  
    6060extern void *set_maxheapsize(size_t);
    6161extern void *as_get_mappable_page(size_t);
    62 extern int as_get_physical_mapping(void *, uintptr_t *);
     62extern int as_get_physical_mapping(const void *, uintptr_t *);
    6363
    6464#endif
  • uspace/lib/c/include/ipc/loc.h

    r85ff862 rf1d6866  
    9797
    9898#endif
     99
     100/** @}
     101 */
Note: See TracChangeset for help on using the changeset viewer.